csharp System.ComponentModel.Win32Exception类(方法)实例源码

下面列出了csharp System.ComponentModel.Win32Exception 类(方法)源码代码实例,从而了解它的用法。

作者:.NET开发    项目:System.ComponentMode   
try {
System.Diagnostics.Process myProc = new System.Diagnostics.Process();
myProc.StartInfo.FileName = "c:\nonexist.exe";  //Attempting to start a non-existing executable
myProc.Start();    //Start the application and assign it to the process component.    
}
catch(Win32Exception w) {
Console.WriteLine(w.Message);
Console.WriteLine(w.ErrorCode.ToString());
Console.WriteLine(w.NativeErrorCode.ToString());
Console.WriteLine(w.StackTrace);
Console.WriteLine(w.Source);
Exception e=w.GetBaseException();
Console.WriteLine(e.Message);
}


问题


面经


文章

微信
公众号

扫码关注公众号