Request.ServerVariables("HTTP_USER_AGENT")

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Moiseszaragoza
    New Member
    • Feb 2007
    • 5

    Request.ServerVariables("HTTP_USER_AGENT")

    I am wondering what is the equivalent of Request.ServerV ariables("HTTP_ USER_AGENT") in C#?

    Thanks
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    That would be:
    Code:
    Request.ServerVariables["HTTP_USER_AGENT"];
    C# uses square brackets [ ] for array indexes rather than the parenthesis ( ) that VB.NET uses.

    But an easier way to do the same (in either language) is:
    Code:
    Request.UserAgent;

    Comment

    Working...