在使用Process类来打开文件时,如果文件类型未知,会得到错误代码为ERROR_NO_ASSOCIATION 的Win32Exception。解决方法很简单![](/Emoticons/wink_smile.gif)
ProcessStartInfo test = new ProcessStartInfo();
![](/Images/OutliningIndicators/None.gif)
test.FileName = "wjh.wjh";
![](/Images/OutliningIndicators/None.gif)
test.ErrorDialog = true;//就是他
![](/Images/OutliningIndicators/None.gif)
Process.Start(test);
这样就会显示“Open With”对话框了
![](/Emoticons/wink_smile.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)