Z
Zhao Yi
I use this code to telnet to a Windows Xp machine.
tn=Net::Telnet.new("Host" => "localhost","Timeout" => 10,"Prompt" =>
/[$%#>] \z/n)
tn.login("user", "123456"){|c| print c}
The output will be:
"
Welcome to Microsoft Telnet Service
login: zhaoyi
password:
"
and then timeout.
tn=Net::Telnet.new("Host" => "localhost","Timeout" => 10,"Prompt" =>
/[$%#>] \z/n)
tn.login("user", "123456"){|c| print c}
The output will be:
"
Welcome to Microsoft Telnet Service
login: zhaoyi
password:
"
and then timeout.