myProcess.StartInfo.FileName==@"C:\WINDOWS\system32\ping.exe 10.0.0.1"; blank is not allowed?

J

James Pang

myProcess.StartInfo.FileName==@"C:\WINDOWS\system32\ping.exe 10.0.0.1";
//this will not work cant find file name...

myProcess.StartInfo.FileName==@"C:\WINDOWS\system32\ping.exe"; //this works
myProcess.StartInfo.RedirectStandardOutput = true;
myProcess.StartInfo.Verb="10.0.0.1";

// myProcess.StartInfo.Verb = "Print";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.StartInfo.UseShellExecute=false;
myProcess.Start();



string output =myProcess.StandardOutput.ReadToEnd();
System.Console.WriteLine(output);
 
D

Dan Bass

"FileName" contains the name of the executable file you're calling.
parameters cannot be passed in via this string... in your instance ping.exe
is the executable and the ip address is the parameter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top