84f191782b
- eliminate chiamate di test da gestore macchine a stati - anticipata caricamento comunicazione macchine rispetto alle macchine a stati - allungato counter di esecuzione processi lanciati - aggiunto dictionary - iniziata gestione finestra custom
29 lines
952 B
VB.net
29 lines
952 B
VB.net
Module ExecProcessManager
|
|
|
|
Friend Function ExecProcess(sFileName As String, sMainLuaPath As String, sArguments As String) As Boolean
|
|
' lancio esecuzione programma
|
|
Dim bResult As Boolean = True
|
|
Dim Proc As New Process()
|
|
Proc.StartInfo.FileName = sFileName
|
|
Proc.StartInfo.RedirectStandardInput = False
|
|
Proc.StartInfo.RedirectStandardOutput = False
|
|
Proc.StartInfo.Arguments = 1.ToString() & " """ & sMainLuaPath & """ """ & sArguments & """"
|
|
Proc.StartInfo.UseShellExecute = False
|
|
Proc.StartInfo.CreateNoWindow = True
|
|
Dim ExecCounter = 0
|
|
If Proc.Start Then
|
|
While Not Proc.HasExited
|
|
If ExecCounter >= 300 Then
|
|
bResult = False
|
|
Proc.Kill()
|
|
Exit While
|
|
End If
|
|
Threading.Thread.Sleep(100)
|
|
ExecCounter += 1
|
|
End While
|
|
End If
|
|
Return bResult
|
|
End Function
|
|
|
|
End Module
|