Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI, friends.

i have tried the following code to get client computer name and
VB
sFullUser1 =trim(Request.ServerVariables ("remote_addr))
Set objWMIService = GetObject("winmgmts:\\" & sFullUser1  & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
For Each objItem in colItems
   response.write "BootDevice: " & objItem.CSName & 
  response.write "BuildNumber: " & objItem.Description
Next

but it is giving only server details. but not the client system details.

Please help me in doing this. how could i get client computer name and computer dexcription and ip address.
as what we have in system properties->computer name tab
Posted
Updated 4-Dec-11 19:50pm
v3

1 solution

As the ASP code is run on the server, due to security reasons you are unable to harvest certain information about your users systems.

For the IP address, you may use:

<%
Dim UserIPAddress
UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If UserIPAddress = "" Then
  UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
End If
%>


Whilst you could just simply use:

Request.ServerVariables("REMOTE_ADDR")


This might not work when the user is behind an office-based proxy.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900