当前位置: 首页>>代码示例>>C#>>正文


C# SshClient.CreateShell方法代码示例

本文整理汇总了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.");
 }
开发者ID:pecegit,项目名称:sshnet,代码行数:20,代码来源:SshClientTest.cs

示例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);
                }
            }
        }
开发者ID:delfinof,项目名称:ssh.net,代码行数:38,代码来源:SshClientTest.cs

示例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.");
 }
开发者ID:pecegit,项目名称:sshnet,代码行数:13,代码来源:SshClientTest.cs

示例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);
                }
            }
        }
开发者ID:delfinof,项目名称:ssh.net,代码行数:21,代码来源:SshClientTest.cs


注:本文中的SshClient.CreateShell方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。