使用powertcp telnet for .net1.0.6返不回输入命令后的结果?请教!
nnh 2009-05-20 05:14:43 using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Dart.PowerTCP.Telnet;
namespace AutoLogin_CS
{
public partial class _Default : System.Web.UI.Page
{
Dart.PowerTCP.Telnet.Telnet telnet1;
protected void Page_Load(object sender, EventArgs e)
{
telnet1 = new Dart.PowerTCP.Telnet.Telnet();
telnet1.ReceiveTimeout = 3000;
Segment seg1 = telnet1.Login("172.16.1.22", "oracle", "oracle", "$");
Response.Write(seg1.ToString());
telnet1.Send("pwd" + "\r\n");
Segment seg2 = telnet1.Receive();
Response.Write(seg2.ToString());
telnet1.Close();
}
}
}
返回结果:
Red Hat Enterprise Linux AS release 3 (Taroon Update 4) Kernel 2.4.21-27.ELsmp on an i686 login: oracle Password: Last login: Wed May 20 16:22:27 from 192.168.1.92 unknown terminal "tty" unknown terminal "tty" [oracle@abc-websphere oracle]$
可是没有返回pwd命令的输出结果呀?请问怎么样才能向linux发送命令,并可返回输出结果呢?