.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> ASP.NET Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Fetch Users User agent, IP address

Posted By:Rajshree       Posted Date: October 28, 2010    Points: 15    Category: ASP.NET Controls    URL: http://www.dotnetspark.com  

Here i am going to give you example to fetch or to show or to store user's mobile/pc user agent, IP address.
 

To Fetch/Store/Show User's Mobile/System User Agent,IP address:

To show user's User Agent at run time:

Declare a variable of String type
Dim mob_UA as String

below i have call a method of Request that takes one parameter and i have specified HTTP_USER_AGENT in double qoute and that HTTP_USER_AGENT will automatically fetch/show name/details of user agent

mob_UA=Request.ServerVariables("HTTP_USER_AGENT")


To Show IP Address:

declare a variable of type String
Dim mob_IP as String

below i have call a same method ServerVariable and passed a new parameter/variable with name REMOTE_ADDR and that variable automatically fetch information about user IP address and it may be of mobile platform or it may be of PC's

mob_IP=Request.ServerVariables("REMOTE_ADDR")

and more oever there is many variables like REMOTE_ADDR and HTTP_USER_AGENT

so i  think this blog helps you.
and for further kindly let me know

Thanking you

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend