VB回显DOS指令

来源:百度知道 编辑:UC知道 时间:2024/06/01 10:14:32
我在网上找了好多代码,均无效。
要求
1、回显DOS指令【必须是即时(不要等到处理完成后显示)】
2、同时进行几个DOS指令
3、使用List空间装载DOS的输出内容。
Shell "cmd /c ping 192.168.8.4>c:\1.txt", vbHide

DoEvents

Open "c:\1.txt" For Input As #1
这句 do while eof(#1) #缺少表达式。

Line Input #1, readrow
Me.List1.AddItem readrow
Loop

我有个办法,用VB或者其它语言做telnet
不用任何API,原理是这样的

shell "cmd /c ping 192.168.8.4>c:\1.txt",vbhide

doevents

open "c:\1.txt" for input as #1
do while eof(#1)
line input #1,readrow
me.list1.additem readrow
loop

这是手工写的,没有进行测试,你自己改一下吧。

apisoft QQ:905906

1.Do sth. /x/x > xxxx.txt
(jiang do de jieguo fuzhi dao xxxx.txt)

list? what?