startprocess
-
anybody knows ? help meeeeee..
-
anybody knows ? help meeeeee..
Please do not post messages like this. If anyone knows the answer to your question they will provide it in their own time.
-
anybody knows ? help meeeeee..
eftekharpour wrote:
anybody knows ? help meeeeee..
Sure. You got to the manual here[^], and then you can read which exceptions the
Start
method might throw, and why. ..and if you click on the Exception and read it, you'll find a nice exception-handler that gives some more detail;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);
}In this particular case, I'd guess that Windows can't find the file - probably because it's not in the local path.
Bastard Programmer from Hell :suss: