C#.net equivalent of system()

A

Amit

Hi,

I'm looking for a C#.net equivalent of the c command "system()"?

Sample Code for reference

C++ code

long nRetVal = system("Login.exe -u userName -p Password");
if(nRetVal == 0)
return true;

C# Code

??

Thanks in Advance.

Regards,
- Amit Gupta
 
M

Marc Gravell

using (Process proc = Process.Start("Login.exe", "-u userName -p
Password")) {
proc.WaitForExit();
if(proc.ExitCode == 0) return true;
}

Marc
 

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