DIM PTEMP as system.diagnostics.process ()
Ptemp = system.diagnostics.process.getProcesses ()
DIM PTEMPPROCESS As System.Diagnostics.Process
For Each pTempProcess In pTempDim sProcessName As String = pTempProcess.ProcessNameDim sProcessID As Int32 = pTempProcess.Id 'EXCEL change the name of the program you need to detect, do not add exeIf StrComp ( "excel", sProcessName, CompareMethod.Text) = 0 ThenDim pProcessTemp As System.Diagnostics.Process' to get the process started running time Dim sStartTime As String = pTempProcess.StartTime.ToString () pProcessTemp = Process.GetProcessById (sProcessID) 'MessageBox.Show'pProcessTemp.Kill ()' pProcessTemp.Close () End IFNext
Non-original