Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Process class and timeout
Message
From
18/05/2014 16:59:49
 
 
To
18/05/2014 15:00:52
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01600187
Message ID:
01600195
Views:
37
I have implemented the following:
            ' If this is the default
            If nTimeout = 0 Then

                ' Wait for the process to complete before proceeding
                loProcess.WaitForExit()

                ' Do some code

            Else

                ' Wait for the process to complete before proceeding
                ' If the timeout occured before it finishes, lTimeout will be True
                If loProcess.WaitForExit(nTimeout * 1000) Then

                ' Do some code

                Else
                    lTimeout = True
                    loProcess.CancelOutputRead()
                    loProcess.CancelErrorRead()
                    loProcess.Kill()
                End If

            End If
The process works. If I pass a timeout value, it will go in the Else with a WaitForExit() with a timeout. If the processes finishes ok, all is ok. If the process finishes due to the timeout, it will go in the Else and will kill the application. At least, this is what it should do. But, the application remains in memory. loProcess.Kill() should terminate the EXE in memory. But, it does not.

Anyone would have an idea on how to fine tune this so it would work?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform