Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Request.ServerVariables["HTTP_X_FORWARDED_FOR"] get only one ipaddress

private string GetUserIP()
{
  string ipList = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

  if (!string.IsNullOrEmpty(ipList))
  {
    return ipList.Split(',')[0];
  }

  return Request.ServerVariables["REMOTE_ADDR"];
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: convert int array to string in C# 
Csharp :: c# wirite to csv 
Csharp :: how to write switch statement unity 
Csharp :: c# shuffle string array 
Csharp :: reference to another script unity 
Csharp :: C# data table primary key from 2 columns 
Csharp :: how to get the color of other label when clicking c# 
Csharp :: how to draw a rectangle in monogame 
Csharp :: how to make a partical system to destroy itself after it finishing 
Csharp :: c# add 1 
Csharp :: c# image to byte array 
Csharp :: car controller script unity 
Csharp :: c sharp int to string 
Csharp :: convert int to string in linq query c# 
Csharp :: elevated priviledge in c# 
Csharp :: make an object disappear from a c# script unity 
Csharp :: remove items from list c# condition 
Csharp :: unity spawn button 
Csharp :: c# sort array string by length 
Csharp :: what type of variable is true or false in c# 
Csharp :: formula text and/or netsuite 
Csharp :: unity hide in inspector 
Csharp :: c# encrypt decrypt string 
Csharp :: repeat 10 timesw c# 
Csharp :: remove carriage returns from string c# 
Csharp :: c# open url 
Csharp :: how to close and reopen an app in c# 
Csharp :: .net core enum select list 
Csharp :: how to get the current time in milliseconds .net 
Csharp :: c# split on multiple characters 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =