Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Executing a new exe from within an exe
Message
De
28/04/2007 16:16:40
 
 
À
23/04/2007 10:15:24
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP1
Divers
Thread ID:
01216984
Message ID:
01220823
Vues:
17
Thanks Alexandre ... it should be noted that Process is in the System.Diagnostics namespace.

~~Bonnie


>if you just want to launch an exe and nothing more then you can do
>
>Dim myProcess As Process = Process.Start(exe file or other file)
>
>Now if you want more control and define what type of window is to display, auguments that you want to pass to the exe, you can use the next code.
>
>Dim processInfo As ProcessStartInfo
>processInfo = New ProcessStartInfo("my.exe")
>processInfo.Arguments = "anyarg"
>processInfo.WindowStyle = ProcessWindowStyle.Normal
>Dim myProcess As Process= Process.Start(processInfo)
>myProcess.WaitForExit(5000)
>' this will wait 5 secs for the process to exit, then you can check if the myProcess.HasExit
>to see if the process had finish or if 5 secs has elapsed and the process is still running.
>
>
>>>Nevermind, thanks...
>>
>>And the answer is .... ?
>>
>>~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform