【发布时间】:2014-01-08 04:51:58
【问题描述】:
我正在尝试为工作编写一个程序,它能够告诉我一个人是否登录了多台 PC。
我正在使用 PStool 的 PSloggedon cmd。
这是我正在试验的代码:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) 处理 Button1.Click
Dim Proc As New System.Diagnostics.Process
Proc.StartInfo = New ProcessStartInfo("psLoggedon")
'right now the textbox will hold a PC ID from a list of PC's in a database.
Proc.StartInfo.Arguments = "-l \\" & TextBox1.Text & ""
Proc.StartInfo.RedirectStandardOutput = True
Proc.StartInfo.UseShellExecute = False
Proc.StartInfo.CreateNoWindow = True
Proc.Start()
MsgBox(Proc.StandardOutput.ReadToEnd)
Proc.Close()
End Sub
但我得到了这个错误:
Win32Exception 未处理: 系统找不到指定的文件
我在这里检查过:
C:\Windows\System32
并确保将应用程序文件复制到那里。
有人可以帮我解释一下我可以做些什么来解决这个问题吗?
附言我使用的是 Windows 7
【问题讨论】: