本文整理匯總了C#中Tamir.SharpSsh.jsch.Session.setTimeout方法的典型用法代碼示例。如果您正苦於以下問題:C# Session.setTimeout方法的具體用法?C# Session.setTimeout怎麽用?C# Session.setTimeout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tamir.SharpSsh.jsch.Session
的用法示例。
在下文中一共展示了Session.setTimeout方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SshStream
/// <summary>
/// Constructs a new SSH stream.
/// </summary>
/// <param name="host">The hostname or IP address of the remote SSH machine</param>
/// <param name="username">The name of the user connecting to the remote machine</param>
/// <param name="password">The password of the user connecting to the remote machine</param>
public SshStream(string host, string username, string password)
{
this.m_host = host;
JSch jsch=new JSch();
m_session=jsch.getSession(username, host, 22);
m_session.setTimeout(9999);
m_session.setPassword( password );
Hashtable config=new Hashtable();
config.Add("StrictHostKeyChecking", "no");
m_session.setConfig(config);
m_session.connect();
m_channel=(ChannelShell)m_session.openChannel("shell");
m_in = m_channel.getInputStream();
m_out = m_channel.getOutputStream();
m_channel.connect();
m_channel.setPtySize(132, 132, 1024, 768);
m_prompt = new Regex("\n");
m_escapeCharPattern = "\\[[0-9;]*[^0-9;]";
}