Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i get ip address of my local system in asp.net?
Posted

hi there..

try this..

C#
// Get request.
HttpRequest request = base.Request;

// Get UserHostAddress property.
string address = request.UserHostAddress;


all the best..
 
Share this answer
 
Hi,

use

in C#
C#
Request.ServerVariables["Remote_ADDR"].ToString();


in SQL - use below link

Get Client IP Address in SQL Server[^]
 
Share this answer
 
You can Use
Server Variables
and
For your local system you can also use
C#
System.Net.IPHostEntry ipE = System.Net.Dns.GetHostEntry(Dns.GetHostName(););
System.Net.IPAddress[] IpA = ipE.AddressList;
textBox2.Text = IpA[0].ToString();
 
Share this answer
 
v3
 
Share this answer
 
v2

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