比如在CMD执行net time后..VB如何获得这个时间??
热心网友
同意楼上的,写一个函数function nettime(ip)open app。path & "\nt。bat" for output as #1print #1,"@net time \\" & ip & " nt。dat"close #1shell app。path & "\nt。bat",vbhidedoevents'这里你查查相关资料,关于shell的WAIT,可能用doevents不能等到执行完成,所以可能得不到需要的数据, 里有资料open app。path & "\nt。dat" for intput as #1dim x as stingdo until eof(1)input #1,xnettime=nettime & xloopnettime=replace(nettime,vbcrlf,"")nettime=replace(nettime," ","")end function调用就可以了,得到什么我不知道,没有可用的服务器。
热心网友
执行命令时把结果重定向到一个文件,再编程分析文件内容。