| Hi Guys, Actually, I've been started a telnet process and passed the Arguments to it. every thing is OK till now, I connect and prompt to enter the username. what should I use to write?, as I tried StreamWriter and StandardInput but didn't sucess. public void TelnetProcess() { Process p = new Process(); p.StartInfo.FileName = "telnet.exe"; p.StartInfo.Arguments = "192.168.1.254 23"; p.StartInfo.UseShellExecute = false; p.Start(); } Thank you for help |
Loading
Sam HobbsPosted Dec 13, 2010, 1:31 AM
Then after the call to p.Start() is done set p.StandardInput to a StreamWriter object. Then write to the StreamWriter object the commands the same as if you were typing them in the Telnet window.
You need to do the same for StandardOutput except you will read from it using a StreamReader.
It is a little complicated and advanced to get the input to go to Telnet coordinated with the output coming from it but that is the basic concept. Look for documentation and articles about redirection of standard input and output.