If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > how to view client registery values using asp script

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-28-06, 21:52
mehran mehran is offline
Registered User
 
Join Date: Apr 2005
Posts: 203
Arrow how to view client registery values using asp script

Hi all. i want to make a asp script that can read certian client registery values but i do not know how to write it. I be happy if an expert show me how.i think it could be done because i have seen html pages that show what version of windows and what browser ect... and i assume that they got this from the registry.Thanks
Reply With Quote
  #2 (permalink)  
Old 03-30-06, 07:49
YeahWhat YeahWhat is offline
Registered User
 
Join Date: May 2005
Posts: 39
If it were just that easy to get a client's registry values from his computer, it would open up a world of security problems.

However, anytime you surf the internet your browser is sending page headers to all the sites; so when an ASP page knows your browser or what Windows version you're using, its not actually reading a clients registry values, its reading a client's browser headers. You use the Request.Servervariables to get that information:
Code:
<%
response.write "Your browser is: " & Request.Servervariables("HTTP_USER_AGENT")
%>
Usually, the information the HTTP_USER_AGENT can also tell you what operating system a client is using, and maybe even their version of Windows, but it usually takes some parsing. The general way to do this works like this:
Code:
<%
Dim UserAgent
UserAgent = Request.ServerVariables("HTTP_USER_AGENT") 
If instr(sUserAgent, "Mac") then
    response.write "You're using a Mac"
elseif instr(sUserAgent, "MSIE") then
    response.write "You're using a PC"
else
    response.write "Well I don't know what the hell you're using"
End if
End Function
%>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On