使用powertcp telnet for .net1.0.6返不回输入命令后的结果?请教!
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发送命令,并可返回输出结果呢? --------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答-------------------- 建议在command命令行里面执行telnet,然后就可以通过进程的输入输出流拿返回结果了。 --------------------编程问答-------------------- 楼上的说法要怎样做呀?
补充:.NET技术 , ASP.NET