I am trying to build a program that will connect to an IP address (preferably that of a router) to a specific port (mainly 80) and will try to authenticate and then go on with further actions.
I started without knowing how to communicate with the router/server so i did this:
while (tcpSocket.Available > 0)
{
int input = tcpSocket.GetStream().ReadByte();
But it always gets a tcpSocket.Available = 0 So then i found out that i have to send a specific cmd for it to talk to me. http://msdn.microsoft.com/en-us/library/cc247846.aspx
and made this
var client = new TcpClient(ip, port);
var data = Encoding.GetEncoding(1252).GetBytes(cmd);
var stm = client.GetStream();
stm.Write(data, 0, data.Length);
Now I dont understand how to format the cmds the cmd based on this http://www.ietf.org/rfc/rfc2941.txt Would be 37 - 1?
Thank you for reading P.S dont know if i should point this to SuperUser or ServerFault