以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  text控件显示问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=113261)

--  作者:aidimeng
--  发布时间:2018/1/12 9:20:00
--  text控件显示问题
如何将 cmd执行的过程动态的显示在窗口的text控件里呢
--  作者:有点甜
--  发布时间:2018/1/12 9:55:00
--  

参考

 

Dim p As new Process()
p.StartInfo.FileName = "cmd.exe"

p.StartInfo.UseShellExecute = False \'关闭Shell的使用

p.StartInfo.RedirectStandardInput = True \'重定向标准输入

p.StartInfo.RedirectStandardOutput = True \'重定向标准输出

p.StartInfo.RedirectStandardError = True \'重定向错误输出

p.StartInfo.CreateNoWindow = True \'设置不显示窗口

p.Start()

p.StandardInput.WriteLine("ping www.baidu.com")
p.StandardInput.WriteLine("exit")
Dim strRst As String = p.StandardOutput.ReadToEnd()

msgbox(strrst)