日期:2014-05-17 浏览次数:21047 次
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.Arguments = "/C telnet 192.168.1.1 ";
p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;//cmd窗口最大化
p.Start();
public class TelnetClient
{
private TcpClient Client;
private NetworkStream ns;
private string m_LogonPrompt = "ogin:";
private string m_PasswordPrompt = "assword:";
private readonly int BuffSize = 1024 * 4;
/// <summary>
/// 登录输入用户名提示字符
/// 默认值:ogin:
/// </summary>
public string LoginPrompt
{
set { m_LogonPrompt = value; }
get { return m_LogonPrompt; }
}
/// <summary>
/// 登录输入密码提示字符
/// 默认值:assword:
/// </summary>
&