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. open external application

open external application

Scheduled Pinned Locked Moved C#
question
5 Posts 3 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.
  • J Offline
    J Offline
    JockerSoft
    wrote on last edited by
    #1

    Hello, sorry if this is a newbie question but here goes anyway. I want to write a simple windows application, that opens an external program (.exe) after clicking on a Button. Can you post the code? How can I find these infos in the MSDN documentation? Thank you

    E 1 Reply Last reply
    0
    • J JockerSoft

      Hello, sorry if this is a newbie question but here goes anyway. I want to write a simple windows application, that opens an external program (.exe) after clicking on a Button. Can you post the code? How can I find these infos in the MSDN documentation? Thank you

      E Offline
      E Offline
      eggie5
      wrote on last edited by
      #2

      using System;
      using System.Diagnostics;

      namespace ConsoleApplication6
      {
      /// /// Summary description for Class1.
      ///
      class Class1
      {
      /// /// The main entry point for the application.
      ///
      [STAThread]
      static void Main(string[] args)
      {
      Process.Start("iexplore.exe");
      Console.WriteLine("Internet Explorer should have started...");
      }
      }
      }

      The things in "code" are what you should take note of, in order to answer your question. /\ |_ E X E GG

      H 1 Reply Last reply
      0
      • E eggie5

        using System;
        using System.Diagnostics;

        namespace ConsoleApplication6
        {
        /// /// Summary description for Class1.
        ///
        class Class1
        {
        /// /// The main entry point for the application.
        ///
        [STAThread]
        static void Main(string[] args)
        {
        Process.Start("iexplore.exe");
        Console.WriteLine("Internet Explorer should have started...");
        }
        }
        }

        The things in "code" are what you should take note of, in order to answer your question. /\ |_ E X E GG

        H Offline
        H Offline
        Heath Stewart
        wrote on last edited by
        #3

        To the original poster, don't forget the value of the documentation - it's where the people that answer your questions learn things. Read the documentation about the System.Diagnostics.Process class and see what else you can do, like provide command line arguments, redirect stdout, stderr, and stdin, and pass shell command verbs for non-executable files (like opening HTML documents with the user's default browser without knowing what their default browser is).

        -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

        J 1 Reply Last reply
        0
        • H Heath Stewart

          To the original poster, don't forget the value of the documentation - it's where the people that answer your questions learn things. Read the documentation about the System.Diagnostics.Process class and see what else you can do, like provide command line arguments, redirect stdout, stderr, and stdin, and pass shell command verbs for non-executable files (like opening HTML documents with the user's default browser without knowing what their default browser is).

          -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

          J Offline
          J Offline
          JockerSoft
          wrote on last edited by
          #4

          thank you very much for the code. I think the MSDN help is great to learn how to use classes/components, but it doesn't explains which class has to be used for a certain purpose. where can I find a handbook that can guide me on finding help on the msdn documentation? I'm looking for help on finding help: weird,isn't it?:)

          H 1 Reply Last reply
          0
          • J JockerSoft

            thank you very much for the code. I think the MSDN help is great to learn how to use classes/components, but it doesn't explains which class has to be used for a certain purpose. where can I find a handbook that can guide me on finding help on the msdn documentation? I'm looking for help on finding help: weird,isn't it?:)

            H Offline
            H Offline
            Heath Stewart
            wrote on last edited by
            #5

            You simply have to review the documentation on MSDN. Get to know what classes there are. It's not like you have to memorize the whole library, just become familiar with what certain namespaces cover (ex, obviously System.IO is for input/output, which includes files and other streams) and you can always lookup stuff when you need to. API documentation is not to teach you how to do things - that's your job and what development is all about. Besides, nothing says you have to use one class over another, or that you couldn't even write your own. Some classes may be better than others for particular uses, but your understanding of those classes and your imagination in how that functionality can be derived is what dictates which classes you should use.

            -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

            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