Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Process class and timeout
Message
De
18/05/2014 16:59:49
 
 
À
18/05/2014 15:00:52
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01600187
Message ID:
01600195
Vues:
38
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform