Click here to Skip to main content
15,899,935 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friends,

How to get windows ip configuration IP address of Ethernet adapter Local Area Connection machine using asp.net web application.

Give your full coding for getting this and step-by-step procedures in aps.net web application.


Advance Wishes and Thanks,

By Seenivasan
Posted
Updated 15-Aug-12 23:05pm
v2

 
Share this answer
 
v2
using System.Net;

private string GetIP()
{
string strHostName = "";
strHostName = System.Net.Dns.GetHostName();

IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(strHostName);

IPAddress[] addr = ipEntry.AddressList;

return addr[addr.Length-1].ToString();

}
 
Share this answer
 
v2
Comments
RAKESH CHAUBEY 16-Aug-12 12:44pm    
thanks
using System.Net;

string IP = Request.ServerVariables["Remote_Addr"].ToString();
string LAddr = Request.ServerVariables["LOCAL_ADDR"].ToString();
 
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