IS this straightforward? Does any one have any good examples? All my google searches return items on how to make telnet clients in dotNet but this overkill for me. I’m trying to do this in C#.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
C# 2.0 and Telnet – Not As Painful As It Sounds
http://geekswithblogs.net/bigpapa/archive/2007/10/08/C-2.0-and-Telnet—Not-As-Painful-As-It.aspx
Or this alternative link.
You can query DNS.GetHostEntry to change a computer name to an
IPHostEntry object.
parameters: AddressFamily.InterNetwork (IP version 4),
SocketType.Stream (rides on InterNetwork and Tcp parameters),
ProtocolType.Tcp (reliable, two-way connection)
this: socket.Connect(endpoint); //yup, it’s that simple Send your
data using socket.Send(… wait, I forgot something. You have to
encode the data first so it can fly across them wires.
Encoding.ASCII.GetBytes to convert the nice message you have for the
server into bytes. Then use socket.Send to send those bytes on their
way.
using socket.Receive Don’t forget to clean up by calling
socket.Close()
Now you can send and receive data using the stream.Write and stream.Read methods, respectively. The stream.Read method returns the number of bytes written to your receiving array, by the way.