Results 1 to 9 of 9

Thread: start another program in c#

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2003
    Location
    CANADA
    Posts
    63

    start another program in c#

    how to start another application with c#?

    sayclicking the button to start Visual studio .net

    thanks for help

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Try this
    Code:
    Process.Start("notepad.exe");
    Make sure you have the using System.Diagnostics namespace referenced.
    Note: if the program is not in the startup path, you will have to provide the full path to the program.

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2003
    Location
    CANADA
    Posts
    63
    d'I need the complete path eg. C:\\Program Files\\...
    ???
    Thx for help!

  4. #4
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Originally posted by session
    d'I need the complete path eg. C:\\Program Files\\...
    ???
    Thx for help!
    Yes

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2003
    Location
    CANADA
    Posts
    63
    ill try it in a bit. thanks!

  6. #6
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    in case you are not aware you need to be able to access the Process function in the first place , the easiest way is to put this at the top of your code page : using System.Diagnostics;
    eg:
    Code:
    using System.Diagnostics;
    //// top of form's code page.
    ////
    	public Process processToStart =new Process();
    
    	private void button1_Click(object sender, System.EventArgs e)
    	{
    	processToStart.StartInfo.FileName="IEXPLORE.exe";
    	processToStart.StartInfo.Arguments="http://google.com";
    	processToStart.Start();
    	}
    	}
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  7. #7

    Thread Starter
    Member
    Join Date
    Apr 2003
    Location
    CANADA
    Posts
    63
    ok. thanks
    but...
    what do these do:
    switch(twinsOnWay)
    {
    case ("twins on the way"):
    MessageBox.Show("for mr and mrs dynamic","twins on the way);
    break;
    }

  8. #8
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    thats my signature , my wife and i are expecting twin babies very soon
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  9. #9

    Thread Starter
    Member
    Join Date
    Apr 2003
    Location
    CANADA
    Posts
    63

    Thumbs up

    awwwwwwwwwww nice! I love twins! but im only 16

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width