win32 system unhandled exception
I want to call third party software in .net application (C#) the code is as follows:
Process proc = new Process();
proc.EnableRaisingEvents = false;
\\name of the file
proc.StartInfo.FileName = "filename";
\\Path where 开发者_如何学编程the file is located
proc.StartInfo.Arguments = "filepath";
proc.Start();
but its throwing an exception Win32 system unhandled exception
Please help
You should really post the actual error message as well as the actual paths to make it easier, but it seems like you might be using the wrong arguments. Rather that setting the filepath as the arguments you should be passing it before the filename so the following might work:
Process proc = new Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = System.IO.Path.Combine("filepath", "filename");
proc.Start();
You can find more information, including a sample, at the MSDN page for Process.Start
here.
精彩评论