Home

C# ASP.Net Request.ServerVariables

Blog Date 18th May 2021

The Code

Request.ServerVariables("remote_addr")
Request.ServerVariables("http_referer")
Request.ServerVariables("http_user_agent")

And also useful

Request.Url.ToString()

The Explanation

Just the basics here. There are a lot more items that C# and ASP.Net can get from the request side including cookies. 

remote_addr - The IP address of the machine that is asking for the web page

http_referer - The link that sent the user to your page. Often this is empty because either the user typed the address in the address bar or it's a spider so this info isn't given or there's some tricks to stop links being tracked back

http_user_agent - This is given by the browser. The idea is to provide the server with some details of the browser in case the server wants to format for certain browsers. Seldom correct, seldom useful, try your best to create code, in particular HTML, that works on (nearly) all browsers. 

Request.Url.ToString() - The web address that was asked for. Basically the contents of the address bar in the browser.


I am a humble one-man-band coder working alone. If you require some bespoke humble code coding contact ren@techsolus.co.uk

Reader's Comments

Post Your Comment Posts/Links Rules

Name

Comment

Add a RELEVANT link (not required)

Upload an image (not required)

No uploaded image
Real person number
Please enter the above number below




Home
Admin Ren's Biking Blog