Home All Groups Group Topic Archive Search About

HTTPBrowserCapabilities Question

Author
23 Dec 2005 2:18 AM
kevinwjames
I'm writing a C# app which analyzes and reports on IIS web logs. I've
got it producing numbers for hits, visits, ips, etc. but I'm having
trouble parsing the UserAgent string so I can get Browser, OS, and
Version information.

So I saw this great System.Web.HTTPBrowserCapabilities object which
will parse the User Agent string for me and tell me everything I need.
Only problem is there's no easy way to create an instance of this
object except by actual getting a request from a browser...

Any ideas of how to use this object's user agent parsing capabilities
on a string that I supply?
Thanks.

Author
23 Dec 2005 5:11 AM
Karl Seguin
I doubt it.  You might have an entry point with the static
HttpcababilitiesBase.GetConfigCapabilities method.  But you'll need to set
up so much pseudo-request stuff that it won't be worth it.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!



<kevinwja***@gmail.com> wrote in message
Show quoteHide quote
news:1135304338.917207.205140@g49g2000cwa.googlegroups.com...
> I'm writing a C# app which analyzes and reports on IIS web logs. I've
> got it producing numbers for hits, visits, ips, etc. but I'm having
> trouble parsing the UserAgent string so I can get Browser, OS, and
> Version information.
>
> So I saw this great System.Web.HTTPBrowserCapabilities object which
> will parse the User Agent string for me and tell me everything I need.
> Only problem is there's no easy way to create an instance of this
> object except by actual getting a request from a browser...
>
> Any ideas of how to use this object's user agent parsing capabilities
> on a string that I supply?
> Thanks.
>
Are all your drivers up to date? click for free checkup

Author
23 Dec 2005 7:58 PM
kevinwjames
Thanks Karl. Actually, I found a solution. I downloaded the Mono C#
source code, found the HttpBrowserCapabilities class. It's easy to
modify, since it compiles fine under Microsoft's .NET.

Bookmark and Share