Can you capture the OS name of a client pc?

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Is there a way to capture the operating system (Mac v. Windows) being used
by a client PC viewing our ASP.NET web site?

Thanks in advance!

Mark
 
You can grab this:

Request.ServerVariables("http_user_agent")

And then try your luck parsing out an OS. Not guaranteed to be in there,
nor is it really at all consistant from PC to PC, but it's sometimes in
there somewhere. I think that's as close as you can get from the server
side of things
 
Where do you get all the ServerVariables parameters? A list of all
 
Ken

Thanks

Ken Cox said:
You can also loop through the collection code and get them. From the
documentations:

Dim loop1, loop2 As Integer
Dim arr1(), arr2() As String
Dim coll As NameValueCollection

' Load ServerVariable collection into NameValueCollection object.
coll=Request.ServerVariables
' Get names of all keys into a string array.
arr1 = coll.AllKeys
For loop1 = 0 To arr1.GetUpperBound(0)
Response.Write("Key: " & arr1(loop1) & "<br>")
arr2 = coll.GetValues(loop1) ' Get all values under this key.
For loop2 = 0 To arr2.GetUpperBound(0)
Response.Write("Value " & CStr(loop2) & ": " & arr2(loop2) & "<br>")
Next loop2
Next loop1

Ken


--
Microsoft MVPs have a question for *you*: Are you patched against the Worm?
http://www.microsoft.com/security/security_bulletins/ms03-026.asp



Thank you Steve
 

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

Back
Top