Click here to Skip to main content
15,889,876 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi everyone
if my ip on internet is 196.221.57.101 in site of show ip
i think this ip of router so there ip to my pc under this
so
how i can get my ip under router by .net
to access
thanks for any help
Posted
Comments
Sergey Alexandrovich Kryukov 11-Sep-11 23:23pm    
You want to get IP... what information do you have on input?
--SA
Mostafa Elsadany 11-Sep-11 23:46pm    
TcpClient tcpclnt = new TcpClient("localhost", 8001);

NetworkStream mynetsream = tcpclnt.GetStream();
StreamWriter myswrite = new StreamWriter(mynetsream);

myswrite.WriteLine(TextBox1 .Text );
myswrite.Close();
mynetsream.Close();
tcpclnt.Close();
Response.Write(tcpclnt.Connected.ToString());
//Console.Read();
when replace to ip and publish give me error

 
Share this answer
 
196.xxx.xxx.xxx IP addresses are unlikely to be Internet - they are much, much more likely to be local LAN addresses, since that range is normally reserved for internal networks and I know of no ISP which is using them.
When you get your IP address, you get you local IP - the Internet IP address is the address by which your ADSL router is known to the outside world, which you internal address being used as a subnet to re-address the packets when they are received.

AFAIK, the only way to find out your the Internet IP address you are using, is to contact a web service and get it to tell you. There is a good article on MSDN about this, which should help: http://msdn.microsoft.com/en-us/magazine/cc163692.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900