请教;关于Process;“进程性能计数器已禁用,因此无法执行所请求的操作。"错误
Try
'返回运行的所有实例
Proc = System.Diagnostics.Process.GetProcessesByName("notepad.exe")
********运行上句时出错,ex.Message为:"进程性能计数器已禁用,因此无法执行所请求的操作。" 为什么呢?
If Proc.Length = 0 Then
ReDim Proc(1)
Proc(0) = New System.Diagnostics.Process
With Proc(0)
.StartInfo.FileName = "notepad.exe"
.StartInfo.Arguments = "temp.txt"
.Start()
End With
End If
Catch ex As Exception
Console.WriteLine( ex.Message)
Finally
End Try