codeKnight
codeKnight

Reputation: 269

how to get browser type in Header UserAgent property with c#?

I need to detect the browser type on c# my server side code

I have an HttpContext context; object on my server code

How do I access the HeaderUserAgent string value ?

context.Request.Headers. doesn't give me the intelisense for it

Upvotes: 1

Views: 783

Answers (1)

Afshin
Afshin

Reputation: 1509

For getting UserAgent from header in string Use this code.

 string UserAgent = context.Request.Headers["User-Agent"]; 

Upvotes: 2

Related Questions