Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Executing a new exe from within an exe
Message
De
23/04/2007 10:15:24
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
 
 
À
22/04/2007 16:03:41
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:
01218885
Vues:
24
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
Alexandre Palma
Senior Application Architect
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform