I want to ask you how to execute the Telnet command through cmd using c#. I am able to do (ping,tracert) but unable to do Telnet.
The objective of my app is to check the network connectivity of the servers. So i am trying to ping,telnet and tracert the server ip. But i am stuck with telenet .. The error cmd is showing "'telnet' is not recognized as an internal or external command, operable program or batch file." I have enabled the telnet client from add and remove program steps.
My code for executing telnet is
System.Diagnostics.ProcessStartInfo procStartInfo =
new System.Diagnostics.ProcessStartInfo("cmd.exe", "/k " + telnet 192.168.74.74 21;
procStartInfo.UseShellExecute = false;
// Do not create the black window.
procStartInfo.CreateNoWindow = false;
// Now we create a process, assign its ProcessStartInfo and start it
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = procStartInfo;
proc.Start();
proc.WaitForExit();
Appreciate all the comments kindly please help.. Waiting for the solution.