Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Opening External Applications

Opening External Applications

Scheduled Pinned Locked Moved C#
tutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    budidharma
    wrote on last edited by
    #1

    I have a openFileDialog which allows the user to specify the location of an application to open. He also selects times to open and close the application. Now all I need to know how to do is run the application. ;) So ... does anyone know how to execute an external application that has the path to the executable specified? Thanks!

    X 1 Reply Last reply
    0
    • B budidharma

      I have a openFileDialog which allows the user to specify the location of an application to open. He also selects times to open and close the application. Now all I need to know how to do is run the application. ;) So ... does anyone know how to execute an external application that has the path to the executable specified? Thanks!

      X Offline
      X Offline
      XRaheemX
      wrote on last edited by
      #2

      System.Diagnostics.Process here is an example of running PING with some arguments:

      using System.Diagnostics;
      
      public void RunPing()
      {
         Process p = new Process();
         p.StartInfo.Arguments = "www.codeproject.com";
         p.StartInfo.FileName = "ping.exe";
         p.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
         p.Start();
         p.WaitForExit(5000); // Use this to pause the code until the application closes (this one times out and continues anyway after 5 seconds)
      }
      
      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups