for i=0 to IE.Document.Links.Length-1
if InStr(IE.Document.Links(i).href, "readmsg?id")>0 then
if InStr(IE.Document.Links(i).innertext, ".request")then exit for
end if
next
if i<IE.Document.Links.Length then
s=IE.Document.Links(i).innertext
seq=CINT(Left(s, InStr(s, ".")-1))
IE.Navigate(IE.Document.Links(i).href)
SlIEp
Recive=IE.Document.getElementsByTagName("pre")(0).innertext
Remove
end if
End Function
Sub DoCmd(cmd)
fname = strTMP&"
\
file.cmd"
Set f = fso.CreateTextFile(fname, true)
f.write(cmd)
f.close
set scriptState =WSSh.Exec("%comspec% /c "&fname&" > "&fname&".
∼
")
While (scriptState.Status = 0)
WScript.Sleep(100)
Wend
r = cmd & rn & "——–" &rn
Set f = fso.OpenTextFile(fname&".
∼
", 1, False)
While Not f.atEndOfStream
r = r+f.ReadLine+rn
Wend
Send(r)
End Sub
Login
Send("ready")
While 0=0
cmd = Recive
if cmd<>"" then DoCmd(cmd)
Wscript.Sleep(20000)
seqw = seqw + 1
if seqw>20 then
Send("ready")
seqw=0
46 ISSN 0236-3933.
Вестник МГТУ им
.
Н
.
Э
.
Баумана
.
Сер
. “
Приборостроение
”. 2005.
№
3