mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-11 13:39:09 +00:00
Add new CreateCommand method to create new command with specified encoding.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text;
|
||||
|
||||
namespace Renci.SshClient
|
||||
{
|
||||
@@ -136,12 +137,24 @@ namespace Renci.SshClient
|
||||
/// Creates the command to be executed.
|
||||
/// </summary>
|
||||
/// <param name="commandText">The command text.</param>
|
||||
/// <returns></returns>
|
||||
/// <returns><see cref="SshCommand"/> object.</returns>
|
||||
public SshCommand CreateCommand(string commandText)
|
||||
{
|
||||
return new SshCommand(this.Session, commandText);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the command to be executed with specified encoding.
|
||||
/// </summary>
|
||||
/// <param name="commandText">The command text.</param>
|
||||
/// <param name="encoding">The encoding to use for results.</param>
|
||||
/// <returns><see cref="SshCommand"/> object which uses specified encoding.</returns>
|
||||
public SshCommand CreateCommand(string commandText, Encoding encoding)
|
||||
{
|
||||
return new SshCommand(this.Session, commandText, encoding);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates and executes the command.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user