A program that killed Excel

xiaoxiao2021-03-06  59

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

转载请注明原文地址:https://www.9cbs.com/read-118560.html

New Post(0)