Hi,
I've downloaded a .exe and I want to run it from within C# with different parameters...
I've seen examples with proc.Start and Run functions.
Which one to use?
What is the difference?
AK
Printable View
Hi,
I've downloaded a .exe and I want to run it from within C# with different parameters...
I've seen examples with proc.Start and Run functions.
Which one to use?
What is the difference?
AK
More specifically now I try writing this:
Now I don't know how to relate these 3? Should I make a call from the main to these 3 functions consecutively?Code:public void contextFTP()
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = @"C:\Windows\System32\ftp.exe";
proc.StartInfo.Arguments = @"user uid pwd";
proc.Start();
}
public void connectFTP()
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = @"C:\Windows\System32\ftp.exe";
proc.StartInfo.Arguments = @"open 123.124.122.121 21";
proc.Start();
}
public void disconnectFTP()
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = @"C:\Windows\System32\ftp.exe";
proc.StartInfo.Arguments = @"disconnect";
proc.Start();
}
Is this the correct way of doing things?
Thanks,
AK