0
SSH .NETコマンドをサーバーに接続してプッシュすることはできますが、トラフPuTTyを接続するとわかりません。SSH .NET ShellStream文字クリーンアップ
ように:?[4iの[4I [0; 1234c
当社のITは、コンソールは、VT320またはVT400 +に設定する必要が言います。 しかし、私はこれに関するドキュメントの詳細を見つけることができませんでした。
この機能はSSH.NETでサポートされていますか?
すでにStreamReaderのすべてのエンコードタイプを試しました。 私は、コンソールを読むために別のポストから、このコードを使用しています:
public static string SendCommand(string cmd, ShellStream sh)
{
StreamReader reader = null;
try
{
reader = new StreamReader(sh, Encoding.Default);
StreamWriter writer = new StreamWriter(sh, Encoding.Default);
writer.AutoFlush = true;
writer.WriteLine(cmd);
while (sh.Length == 0)
{
Thread.Sleep(1500);
}
}
catch (Exception ex)
{
Console.WriteLine("exception: " + ex.ToString());
}
return reader.ReadToEnd();
}