Click here to Skip to main content
15,905,148 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a textbox in a page call enquiry.

i want when my page loads my ip address will come automatically in that texbox... please help me..i need your suggestions as soon as possible .
Posted

if you are looking for C# code then refer
How to get Public Ip address of a user in C#

for asp.net code refer
Retrieving User's IP Address using ASP.NET (with sample code)

Get some idea from this examples and call function directly on page_load event
 
Share this answer
 
Try This it is working my side

string host = Dns.GetHostName();
  IPHostEntry ip = Dns.GetHostEntry(host);
    TextBox1.Text= ip.AddressList[1].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