Hello sir,
can anyone help me
how to get client machine ip address in asp.net (visual studio 10) c# or vb.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rishikesh Kumar SinghRank #1,250 · 1.4K reputationPosted Jan 27, 2013, 3:51 AM EST
But if you want to know the ip address of the client machine then that you have to do this using the javascript and html because .html file is always processed by the browser on the client machine .
so, you make use of javascript to find out the ip address of the client machine.
you go through the link, here you will see how we can find the ip address using javascript. definitely your problem will be solved out.
http://www.aspdotnet-suresh.com/2013/01/javascript-get-user-details-ip-address.html#more
if it helps you then mark it as an accepted answer and otherwise let me know.
Rishikesh Kumar SinghRank #1,250 · 1.4K reputationPosted Jan 21, 2013, 2:49 AM EST
string ip = "";
string strHostName = "";
strHostName = System.Net.Dns.GetHostName();
IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(strHostName);
IPAddress[] addr = ipEntry.AddressList; // this will give the address list
Try the above piece of code...It will definitely help you.If not then do contact me..
Vaibhav Kanase113 reputationPosted Jan 21, 2013, 6:23 PM EST
Thanks for your time.
Vaibhav Kanase113 reputationPosted Jan 28, 2013, 5:06 AM EST
Finally my problem is solve.
Rishikesh Kumar SinghRank #1,250 · 1.4K reputationPosted Jan 28, 2013, 7:31 PM EST