How to find name of operating sysytem, IP and browser name of user inC#

V

vimal.424

Can anybody tell me how can I find name of operating system, type of
browser and IP address of the user in C# ? ("User" who is browsing our
site.)
 
A

Alberto Poblacion

Can anybody tell me how can I find name of operating system, type of
browser and IP address of the user in C# ? ("User" who is browsing our
site.)

Take a look at the properties of the Request object, for instance:

Request.UserAgent wil give you a string that contains the type of
browser and (possibly) the operating system.

Request.UserHostAddress will give you the IP (this is the public IP from
which you are receiving the IP packets, not necesarily the IP of the user's
computer, which can be hidden behind a proxy or a NAT gateway).

Also, User.Identity.Name will give you the name of the user who is
browsing your site, but only if you have previously gone through user
authentication (Forms or Windows). The original credentials of the user in
the PC are not sent to the server unless you have configured IIS for
integrated windows authentication and it is enabled at the user's computer.
 
V

vimal.424

Take a look at the properties of the Request object, for instance:

Request.UserAgent wil give you a string that contains the type of
browser and (possibly) the operating system.

Request.UserHostAddress will give you the IP (this is the public IP from
which you are receiving the IP packets, not necesarily the IP of the user's
computer, which can be hidden behind a proxy or a NAT gateway).

Also, User.Identity.Name will give you the name of the user who is
browsing your site, but only if you have previously gone through user
authentication (Forms or Windows). The original credentials of the user in
the PC are not sent to the server unless you have configured IIS for
integrated windows authentication and it is enabled at the user's computer.


Please tell me the full working code.
b'coz i'm new in C# & i'don't know how to use.
thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top