Reputation: 709
I know how to get the IP address but is there a way for me to get the client machine name?
addr = request.servervariables("REMOTE_ADDR")
Upvotes: 0
Views: 2814
Reputation: 2757
The only method that has worked for me is to have some local VBScript send back the information - which will only work in IE.
Because I'm working on a corporate intranet where I know everyone is using IE, it was a workable solution. I did eventually migrate some of the code (notably sending back the machine name) to a deployed HTA (HTML Application) in a recent update. Since HTA's only work on Windows, and always use the IE rendering engine, it removed some of the concerns we had with people potentially accessign it on non-IE browsers.
Inside a text file with a .hta
extension, we have the following which sends back to the server the machine name:
<HTML>
<HEAD>
<TITLE>Full Name of App</TITLE>
<HTA:APPLICATION ID="AppID" APPLICATIONNAME="AppID" SHOWINTASKBAR="yes"
SINGLEINSTANCE = "yes" WINDOWSTATE="maximize" ICON="http://example.com/favicon.ico">
<STYLE TYPE="text/css">
html, body {margin:0px;padding:0px;}
iframe {margin:0px;}
</STYLE>
</HEAD>
<BODY scroll="no">
<script type="text/vbscript">
Set objNet = CreateObject("WScript.NetWork")
document.write("<iframe id=""frmClient"" trusted=""yes"" src=""http://example.com/projects/projectname/default.asp?Workstation=" & objNet.ComputerName & """ WIDTH=""100%"" HEIGHT=""100%""></IFRAME>")
Set objNet = Nothing
</script>
</BODY>
</HTML>
Obviously this may not work for you depending on what you may or may not be able to use - I figured I'd post this in case it's helpful for someone with similar constraints to my usage.
Upvotes: 1
Reputation: 114417
You can't. HTTP does not transmit that information. A Windows network does, which is not HTTP.
Upvotes: 2