Getting user information...

  • Thread starter Thread starter RAB
  • Start date Start date
R

RAB

When an anonymous user visits my website what basic information can I
gather about them? I thought I read somewhere that I could get the
name of the server that is requesting my website http code? If this
is the case what would be some VB code code to capture this
information in a string variable?

Thanks in advance,
RABMissouri2007
 
When an anonymous user visits my website what basic information can I
gather about them? I thought I read somewhere that I could get the
name of the server that is requesting my website http code? If this
is the case what would be some VB code code to capture this
information in a string variable?

Thanks in advance,
RABMissouri2007

You can get the client IP address, name of the browser (User-Agent)
and a previous site visited by the user, that linked to your site
(Referrer).

' IP Address
_UserHostAddress =
HttpContext.Current.Request.UserHostAddress.ToString

' Browser
_UserAgent = HttpContext.Current.Request.UserAgent.ToString

' Referrer
_Referrer = HttpContext.Current.Request.UrlReferrer.ToString
 
client IP address
HttpContext.Current.Request.UserHostAddress.ToString

So easily spoofed (via proxies or other methods) these days...
name of the browser (User-Agent)
HttpContext.Current.Request.UserAgent.ToString

Several browsers are now capable of pretending to be different browsers...
previous site visited by the user, that linked to your site
HttpContext.Current.Request.UrlReferrer.ToString

More and more ISPs are stripping this off...

Not really worth bothering with...
 
Back
Top