Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 什么会导致进程崩溃。是否开始使用mailto:地址使应用程序崩溃?_C#_Wpf_Url_Mailto_Process.start - Fatal编程技术网

C# 什么会导致进程崩溃。是否开始使用mailto:地址使应用程序崩溃?

C# 什么会导致进程崩溃。是否开始使用mailto:地址使应用程序崩溃?,c#,wpf,url,mailto,process.start,C#,Wpf,Url,Mailto,Process.start,不确定这是为什么,但下面的一行使我们的WPF应用程序崩溃 Process.Start(“mailto:example@stackoverflow.com"); 例外情况如下: System.ComponentModel.Win32Exception HResult=0x80004005 Message=The system cannot find the file specified. Source=System.Diagnostics.Process StackTrace:

不确定这是为什么,但下面的一行使我们的WPF应用程序崩溃

Process.Start(“mailto:example@stackoverflow.com");
例外情况如下:

System.ComponentModel.Win32Exception
  HResult=0x80004005
  Message=The system cannot find the file specified.
  Source=System.Diagnostics.Process
  StackTrace:
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
注意:没有报告“InnerException”

我已经通过使用
mailto:
hyperlink来编写这个简单的HTML文件来确认邮件处理程序已正确注册,以测试


单击链接,邮件客户端将按预期打开

根据网站上的另一篇帖子,我也尝试了混合交互方法,导入了这个

xmlns:i=”http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei=”http://schemas.microsoft.com/expression/2010/interactions"
然后像这样使用它


但我也有同样的例外


那么是什么原因导致了这种情况呢?

尝试设置UseShellExecute:

System.Diagnostics.Process.Start(new ProcessStartInfo("mailto:example@stackoverflow.com") { UseShellExecute = true });

UseShellExecute
可能是
false