Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / March 2004

Tip: Looking for answers? Try searching our database.

External Process Wait n Seconds?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
localhost - 04 Mar 2004 21:43 GMT
I want to launch a .exe with "new Process();" and wait for 20 seconds
for it to quit before I thow an exception.  Can anyone show a quick
example on how to do that?

Thanks.
"Ying-Shen Yu[MSFT]" - 05 Mar 2004 03:05 GMT
Hi,
Since you need a timeout when waiting on a process exit.
Process.WaitForExit is not suitable for you.
One way I can think of is using a timer in your program, checking the
Process.HasExited property in the OnTimer event handler.
If you need block your program at that point, you may try using a loop with
some Thread.Sleep call instead.

Does solve your problem?
Please feel free to reply to this thread if you still have problem on this
issue.

Best regards,

Ying-Shen Yu [MSFT]
Microsoft community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.