本文整理汇总了C#中SshClient.CreateShellStream方法的典型用法代码示例。如果您正苦于以下问题:C# SshClient.CreateShellStream方法的具体用法?C# SshClient.CreateShellStream怎么用?C# SshClient.CreateShellStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SshClient
的用法示例。
在下文中一共展示了SshClient.CreateShellStream方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateShellStreamTest
public void CreateShellStreamTest()
{
ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
string terminalName = string.Empty; // TODO: Initialize to an appropriate value
uint columns = 0; // TODO: Initialize to an appropriate value
uint rows = 0; // TODO: Initialize to an appropriate value
uint width = 0; // TODO: Initialize to an appropriate value
uint height = 0; // TODO: Initialize to an appropriate value
int bufferSize = 0; // TODO: Initialize to an appropriate value
IDictionary<TerminalModes, uint> terminalModeValues = null; // TODO: Initialize to an appropriate value
ShellStream expected = null; // TODO: Initialize to an appropriate value
ShellStream actual;
actual = target.CreateShellStream(terminalName, columns, rows, width, height, bufferSize, terminalModeValues);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
示例2: CreateShellStream2_NeverConnected
public void CreateShellStream2_NeverConnected()
{
using (var client = new SshClient(Resources.HOST, Resources.USERNAME, "invalid password"))
{
const string terminalName = "vt100";
const uint columns = 80;
const uint rows = 25;
const uint width = 640;
const uint height = 480;
var terminalModes = new Dictionary<TerminalModes, uint>();
const int bufferSize = 4096;
try
{
client.CreateShellStream(terminalName, columns, rows, width, height, bufferSize, terminalModes);
Assert.Fail();
}
catch (SshConnectionException ex)
{
Assert.IsNull(ex.InnerException);
Assert.AreEqual("Client not connected.", ex.Message);
}
}
}