Cisco デバイスとの telnet セッションを確立し、デバイスの応答に応じてコマンドを送信する必要があります。
私は試した:
ヘッダー:
using System.Net;
using System.Net.Sockets;
コード:
TelnetConnection tc = new TelnetConnection("gobelijn", 23);
Telnet t = new Telnet();
どちらもうまくいきません!
次のエラーが表示されます。
The type or namespace name 'TelnetConnection' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'Telnet' could not be found (are you missing a using directive or an assembly reference?)
私はここで完全に道に迷っており、サポートが必要です。
また、Telnet ではなく SSH を使って簡単に接続する方法があれば教えてください。
アップデート
アンドレアスが述べたことに従いましたが、今はエラーが発生しています:
System.Exception: Failed to connect : no login prompt
at ciscoManager.TelnetConnection.Login(String Username, String Password, Int32 LoginTimeOutMs)
at ciscoManager.Program.Main(String[] args)
私のコードでは、「Enter」キーを押して送信しようとしていますが、喜び\r\n
もありませんでした!\n
助けが必要!