启动Outlook命令行开关

时间:2015-09-22 15:03:07

标签: c# outlook

我有以下代码:

Microsoft.Win32.RegistryKey key =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\microsoft\\windows\\
currentversion\\app paths\\OUTLOOK.EXE");

string path = (string)key.GetValue("Path");

if( path != null)
  System.Diagnostics.Process.Start("OUTLOOK.EXE");
else
 MessageBox.Show("There is no Outlook in this computer!", "SystemError",       

MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

代码工作正常,但我希望以不同的方式启动Outlook,使用命令行开关,如:Safe,cleanreminders,cleanrules。

有什么想法吗?

提前致谢

1 个答案:

答案 0 :(得分:0)

我在http://www.dotnetperls.com/process

找到的一个例子
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "WINWORD.EXE";
startInfo.Arguments = file;
Process.Start(startInfo);

参数: 存储参数,例如-flags或filename。这是一个字符串属性。