A basic shell question

This is a discussion on A basic shell question within the C# Programming forums, part of the General Programming Boards category; Hi, I've downloaded a .exe and I want to run it from within C# with different parameters... I've seen examples ...

  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    141

    A basic shell question

    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

  2. #2
    Registered User
    Join Date
    Dec 2005
    Posts
    141
    More specifically now I try writing this:
    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();
            }
    Now I don't know how to relate these 3? Should I make a call from the main to these 3 functions consecutively?
    Is this the correct way of doing things?

    Thanks,
    AK

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Basic question about GSL ODE func RK4
    By cosmich in forum Game Programming
    Replies: 1
    Last Post: 05-07-2007, 02:27 AM
  2. shell script basic question
    By PedroTuga in forum Linux Programming
    Replies: 1
    Last Post: 09-09-2006, 03:24 AM
  3. Visual Basic Question
    By Xeavor in forum Tech Board
    Replies: 5
    Last Post: 12-02-2004, 08:59 AM
  4. A very basic question
    By AshFooYoung in forum C Programming
    Replies: 8
    Last Post: 10-07-2001, 03:37 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21