Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

get client ip address c#

//get client ip address
Public string GetIp()
{
string ip = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (string.IsNullOrEmpty(ip))
{
ip = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
}
  return ip;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: get enum name 
Csharp :: how to do a messagebox in c# 
Csharp :: replace index in string c# 
Csharp :: c# get array subarray 
Csharp :: c# field vs property 
Csharp :: Play Sound c# 
Csharp :: rotate player unity 
Csharp :: convert string to list int c# 
Csharp :: get folder path winforms 
Csharp :: c# new dictionary linq 
Csharp :: wpf c# select folder path 
Csharp :: save byte array to file c# 
Csharp :: Local to global position unity 
Csharp :: get out of foreach statement c# 
Csharp :: how to check datagridview cell is null or empty 
Csharp :: unity call function on animation onstateexit 
Csharp :: c# enum syntax 
Csharp :: c# get country code 
Csharp :: unity button press 
Csharp :: weapon switching unity 
Csharp :: variable gameobject unity 
Csharp :: c# list declaration 
Csharp :: c# string interpolation 
Csharp :: Customize yup number 
Csharp :: c# for statement 
Csharp :: c# set cursor pos 
Csharp :: list to array c# 
Csharp :: minimize maximize restore wpf buttons 
Csharp :: how to print something in c# 
Csharp :: how to remove all whitespace from a string in c# 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =