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