How to get Internet protocol address using asp.net.Internet protocol is a communication between the nodes. Internet protocol, which is used to track a system host and used address the location. If we need to identify the user
who are all accessing our website and store the Internet protocol address in our database is very simple and very easier.
This is the way to track the users Internet protocol address.Fetch a client's Internet protocol address as soon as he access our web site in asp.net.
Some of them may use a proxy Internet protocol address. But we can get their Internet protocol address with this simple code.
Here am giving two methods to find the Internet protocol adress.
using System.Net;//Add the Namespace
//Get Visitor IP address method
public string GetVisitorIpAddress()
{
string stringIpAddress;
stringIpAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (stringIpAddress == null) //may be the HTTP_X_FORWARDED_FOR is null
{
stringIpAddress = Request.ServerVariables["REMOTE_ADDR"];//we can use REMOTE_ADDR
}
return "Visitor IP is "+stringIpAddress;
}
//Get Lan Connected IP address method
public string GetLanIPAddress()
{
//Get the Host Name
string stringHostName = Dns.GetHostName();
//Get The Ip Host Entry
IPHostEntry ipHostEntries = Dns.GetHostEntry(stringHostName);
//Get The Ip Address From The Ip Host Entry Address List
IPAddress[] arrIpAddress = ipHostEntries.AddressList;
return arrIpAddress[arrIpAddress.Length - 1].ToString();
}
//Get The Visitor Ip Address
string strVisitorIpAddress = GetVisitorIpAddress();
//Get The Lan Ip Address
string strLanIpAddress = GetLanIPAddress();
you will get their ip address.
thanks for sharing!
ReplyDeleteGreat article thanks for sharing
ReplyDeleteWe can also submit our .net related links on http://www.dotnettechy.com to increase traffics of your website / blog
Its kind of social networking for .Net professionals only
ASP.Net application is running on server in IIS , but i cant get the ip address of the local systems through your code, it returns the ip address of server .
ReplyDeleteExcellent items from you, mаn. I have consiԁer your stuff previous tօ and yoս
ReplyDeleteare simply too magnificent. ӏ actually liƙe wҺat you've
acquired гight here, really like what үou are stating
and tɦe best way whеrein you say it. You are maҟing it entertaining аnd ʏоu still care for
to stay it smart. Ӏ can't wait tߋ read far more feom yօu.
Thіs iss гeally a greаt website.
Feel free to surf tߋ my website :: coupons
I have read your blog its very attractive and impressive. I like it your blog.
ReplyDeleteDot Net Training in Chennai | Online Dot Net Training
Online Dot Net Training | LINQ Online Training | ASP.NET Training in Chennai
Useful post. Keep sharing such a valuable post.
ReplyDeletewordpress Training in Chennai
his article is very nice and easy to understand, it was a very weighty once thanks a lot admin can hopefully be improved in the future and pardon me permission to share the article here : Cara menyembuhkan gagal jantung
ReplyDeleteAnyone tracking the IP address of the computer will then see this fake IP and not the original one that was provided by the Internet Service Provider. hiding ip address
ReplyDeleteThere are a few methods for finding your Ethernet and interchanges convention data.myip info
ReplyDeleteWow, what an information. Very interesting. Thanks for sharing.
ReplyDeleteBest Mobility Services | Austere Technologies
Some site proprietors make utilization of the IP area database to modify their quality on the web.is wearable technology safe
ReplyDeleteThe separation between your nation and the server's nation matters a ton. The more drawn out the separation, the moderate the association speed will be. router ip
ReplyDeleteRousing and particularly significant, significantly recommended for all bloggers out there.
ReplyDelete192 .168.0.1
Such an excellent and interesting blog, do post like this more with more information, this was very useful. Salesforce Training India
ReplyDelete