各位高人,谁能告诉我如何在VB.net下使用PsTools啊?

kinglee1220 2008-05-13 04:26:42
如何在vb.net 中使用PsTools啊?
当作第三方控件?
怎么输入命令啊?
有没有例子给一个看看好么?
...全文
48 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
kinglee1220 2008-05-15
  • 打赏
  • 举报
回复
解决了
把参照的代码贴出来,大家可以参照
Dim myProcess As Process = New Process()
  Dim s As String
  myProcess.StartInfo.FileName = "cmd.exe"
  myProcess.StartInfo.UseShellExecute = False
  myProcess.StartInfo.CreateNoWindow = True
  myProcess.StartInfo.RedirectStandardInput = True
  myProcess.StartInfo.RedirectStandardOutput = True
  myProcess.StartInfo.RedirectStandardError = True
  myProcess.Start()
  Dim sIn As StreamWriter = myProcess.StandardInput
  sIn.AutoFlush = True
  Dim sOut As StreamReader = myProcess.StandardOutput
  Dim sErr As StreamReader = myProcess.StandardError
  sIn.Write("dir c:\Windows\system32\*.com" & _
  System.Environment.NewLine)
  sIn.Write("exit" & System.Environment.NewLine)
  s = sOut.ReadToEnd()
  If Not myProcess.HasExited Then
  myProcess.Kill()
  End If
  MessageBox.Show("The 'dir' command window was " & _
  closed at: " & myProcess.ExitTime & "." & _
  System.Environment.NewLine & "Exit Code: " & _
  myProcess.ExitCode)
  sIn.Close()
  sOut.Close()
  sErr.Close()
  myProcess.Close()
  MessageBox.Show(s)
kinglee1220 2008-05-14
  • 打赏
  • 举报
回复
有没有那位高人给小弟指点一下啊~~~~
iasker 2008-05-14
  • 打赏
  • 举报
回复
顶一下
我也没有用过
kinglee1220 2008-05-13
  • 打赏
  • 举报
回复
有没有用过的啊,怎么都没人知道呢。该死的组长!非得让我用这个软件!

8,833

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 组件/控件开发
社区管理员
  • 组件/控件开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧