class Program
{
public static void ExecuteCommand(string Command)
{
ProcessStartInfo ProcessInfo;
Process Process;
ProcessInfo = new ProcessStartInfo("cmd.exe", "/C " + Command);
ProcessInfo.CreateNoWindow = false;
ProcessInfo.UseShellExecute = false;
Process = Process.Start(ProcessInfo);
Process.WaitForExit();
Process.Close();
}
static void Main()
{
ExecuteCommand("telnet 169.254.0.1");
}
}
它運行cmd並通過telnet連接到特定設備。接下來,一旦連接,它會提示輸入我想發送的登錄名和密碼,然後在那幾個特定的命令之後。我該怎麼辦?在cmd中發送多個TELNET命令
非常感謝!
並請,使用谷歌:) – animaonline