以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 类似日志模式怎么实现啊 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=113726) |
-- 作者:aidimeng -- 发布时间:2018/1/22 9:31:00 -- 类似日志模式怎么实现啊 ![]() ![]() 想实现上面的效果,就是把cmd里执行的命名 在text中动态的显示下 |
-- 作者:有点甜 -- 发布时间:2018/1/22 9:34:00 -- 参考
Dim p As new Process() 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") msgbox(strrst) |
-- 作者:aidimeng -- 发布时间:2018/1/22 9:37:00 -- 原本想着逐行显示的,找个后期我在修改下。请问下, 我能获取到cmd的返回值吗 ?比如 %errorlevel% [此贴子已经被作者于2018/1/22 10:54:47编辑过]
|
-- 作者:aidimeng -- 发布时间:2018/1/22 13:08:00 -- 我可以获取到图片中的错误吗 [此贴子已经被作者于2018/1/22 13:08:57编辑过]
|
-- 作者:有点甜 -- 发布时间:2018/1/22 14:42:00 -- 如果要获取环境变量,就这样处理
Dim p As new Process() 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("set path") msgbox(strrst) |
-- 作者:有点甜 -- 发布时间:2018/1/22 14:44:00 -- 如果是telnet,参考
http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=105012&skin=0
|