System.Diagnostics.Process.Start 不能打開調用oullook並添加附件嗎???
帶附件時,帶時命令行參數不對,他點解別人寫出來是可以添加附件。有高人指教嗎???
代碼如下:
Microsoft.Win32.RegistryKey rKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(@"mailto\shell\open\command");//這裡我們查找系統的缺省郵件客戶程序,其他的客戶程序我沒有試驗過,不知道這種方式是否可行
if (rKey != null)
{//這裡查找Outlook應用程序所在位置,也可以用其他方式去查
string path = rKey.GetValue("").ToString() + " ";
path = path.Substring(0, path.IndexOf(" "));
path = path.Replace("\"", "");
rKey.Close();
try
{
System.Text.StringBuilder GetPath = new System.Text.StringBuilder(260);
oDshowEx.GetSnapFilePath(this.frame.SelectedCam.DevPtr, GetPath);
string s = GetPath.ToString();
subject = "hello";
EmailTo = "[email protected]";
AttachPath = "c:/11.bmp";
System.Diagnostics.Process.Start(path, "-c IPM.Note /m [email protected]&subject=Hello " + " " + AttachPath);
}
catch
{
}
http://www.cnblogs.com/vcool/archive/2010/03/04/1678122.html