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. Wait for external application to complite and than continue??

Wait for external application to complite and than continue??

Scheduled Pinned Locked Moved C#
questionhelp
7 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.
  • A Offline
    A Offline
    adnanh75
    wrote on last edited by
    #1

    Hi, In my application I have to call an external application (System.Diagnostics.Process.Start("C:\\NeckingRa\\Fortran\\necking_contour.exe"), (command window) , which creates one FILE that I need for my calculation, and thats why I need to pause my app untill external app is done (terminated).. Please, can somebody help me?? How can I do it?? Thanks

    L A 2 Replies Last reply
    0
    • A adnanh75

      Hi, In my application I have to call an external application (System.Diagnostics.Process.Start("C:\\NeckingRa\\Fortran\\necking_contour.exe"), (command window) , which creates one FILE that I need for my calculation, and thats why I need to pause my app untill external app is done (terminated).. Please, can somebody help me?? How can I do it?? Thanks

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      Process.EnableRaisingEvents = true;
      Process.Exited += new EventHandler(somemethod);

      top secret
      Download xacc-ide 0.0.3 now!
      See some screenshots

      1 Reply Last reply
      0
      • A adnanh75

        Hi, In my application I have to call an external application (System.Diagnostics.Process.Start("C:\\NeckingRa\\Fortran\\necking_contour.exe"), (command window) , which creates one FILE that I need for my calculation, and thats why I need to pause my app untill external app is done (terminated).. Please, can somebody help me?? How can I do it?? Thanks

        A Offline
        A Offline
        adnanh75
        wrote on last edited by
        #3

        cant find .EnableRaisingEvents

        M 1 Reply Last reply
        0
        • A adnanh75

          cant find .EnableRaisingEvents

          M Offline
          M Offline
          mav northwind
          wrote on last edited by
          #4

          It's a property of the Process class. You get an instance of Process from System.Diagnostics.Process.Start()... mav

          A 1 Reply Last reply
          0
          • M mav northwind

            It's a property of the Process class. You get an instance of Process from System.Diagnostics.Process.Start()... mav

            A Offline
            A Offline
            adnanh75
            wrote on last edited by
            #5

            Firs thankYou for help.. But I am not wery god in it.. I have to make a little application and call extern .exe file, wait untill its done and go on.. this extern .exe file creates a file i need in my calculation.. i have a button, and when I click on it: private void button3_Click(object sender, System.EventArgs e) { System.Diagnostics.Process.Start"C:\\NeckingRa\\Fortran\\necking_contour.exe"); ********* Hier I have to wait until this .exe app creates output.dat*************** ********* how would U do it? Can U please write it for me, (I am beginer :)******** System.IO.File.Exists("C:\\NeckingRa\\Temp\\output.dat"); System.IO.File.Copy("C:\\NeckingRa\\Temp\\output.dat",DSave.FileName,true); }

            M 1 Reply Last reply
            0
            • A adnanh75

              Firs thankYou for help.. But I am not wery god in it.. I have to make a little application and call extern .exe file, wait untill its done and go on.. this extern .exe file creates a file i need in my calculation.. i have a button, and when I click on it: private void button3_Click(object sender, System.EventArgs e) { System.Diagnostics.Process.Start"C:\\NeckingRa\\Fortran\\necking_contour.exe"); ********* Hier I have to wait until this .exe app creates output.dat*************** ********* how would U do it? Can U please write it for me, (I am beginer :)******** System.IO.File.Exists("C:\\NeckingRa\\Temp\\output.dat"); System.IO.File.Copy("C:\\NeckingRa\\Temp\\output.dat",DSave.FileName,true); }

              M Offline
              M Offline
              mav northwind
              wrote on last edited by
              #6

              // Makes things easier
              using System.IO;
              using System.Diagnostics;

              private void button3_Click(object sender, System.EventArgs e)
              {
              Process p = Process.Start("C:\\NeckingRa\\Fortran\\necking_contour.exe");
              p.EnableRaisingEvents = true;
              p.Exited += new EventHandler(ProcessExited);
              }

              private void ProcessExited(object sender, EventArgs e)
              {
              if (System.IO.File.Exists("C:\\NeckingRa\\Temp\\output.dat"))
              System.IO.File.Copy("C:\\NeckingRa\\Temp\\output.dat",DSave.FileName,true);

              }

              The bill is in the mail ;) mav

              A 1 Reply Last reply
              0
              • M mav northwind

                // Makes things easier
                using System.IO;
                using System.Diagnostics;

                private void button3_Click(object sender, System.EventArgs e)
                {
                Process p = Process.Start("C:\\NeckingRa\\Fortran\\necking_contour.exe");
                p.EnableRaisingEvents = true;
                p.Exited += new EventHandler(ProcessExited);
                }

                private void ProcessExited(object sender, EventArgs e)
                {
                if (System.IO.File.Exists("C:\\NeckingRa\\Temp\\output.dat"))
                System.IO.File.Copy("C:\\NeckingRa\\Temp\\output.dat",DSave.FileName,true);

                }

                The bill is in the mail ;) mav

                A Offline
                A Offline
                adnanh75
                wrote on last edited by
                #7

                Thank U, it works now.. Great, I am very very thankful for Your Help.. There are still a lot of Great an Cool people outthere in the World.. Once again Thanx :)

                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