Fetching IP Address. [Resolved]

Posted by Neer under C# on 2/2/2012 | Points: 10 | Views : 1286 | Status : [Member] | Replies : 3
Hi

I want To Store the IP Address in my database , from where my site login has been attempted or logg innd...

what is the method to fetch IP Address.. ?? IS It possible??

- Neer

-Neer


Responses

Posted by: Naidulaxmi on: 2/2/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi ,

Just tested this on my machine and it works.


" using System.Net;

string host = Dns.GetHostName();
IPHostEntry ip = Dns.GetHostEntry(host);
Console.WriteLine(ip.AddressList[0].ToString());"

Naidu


appalanaidu

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naraayanan on: 2/3/2012 [Member] Starter | Points: 25

Up
0
Down
Hi
Check this link
http://www.c-sharpcorner.com/UploadFile/mahesh/get_ip11152005064604AM/get_ip.aspx

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neer on: 2/7/2012 [Member] Starter | Points: 25

Up
0
Down
Thank U So much mr.Naidulaxmi..

-Neer

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response