retrieve local machine environment variable from ASP page

A

adam

Hi ASP Expert,

My goal is to retrieve my local machine's %USERNAME% environment variable
from ASP page.
When I enter http://RemoteServerName/testusername.asp?id=%USERNAME% directly
into the IE Browser URL box, %USERNAME% is repalced with the local machine
ID. However, when I create a
<a href="http://RemoteServerName/testusername.asp?id=%USERNAME%"> get
mahcine id</a> in an html file and use Request.Querystring("id") to retrieve
it in testusername.asp page, it returns "%USERNAME%". I guess IE browser is
smart enough to replace %USERNAME% with the local environment variable value
before sending URL string to the web server when you type directly into the
Browser URL box.

My question is , is there any way to retrieve local machine's environment
variable, %USERNAME% from ASP page?

Thanks very much!!!
 
R

Ray Costanzo [MVP]

How about by authenticating your users? If the NT username matters to you,
can I assume that this is on an intranet? If so, in a domain I'd hope?
Turn on Integrated Windows Authentication in IIS and turn off anonymous
access and use Request.ServerVariables("AUTH_USER") to get the account name.

Ray at work
 
E

Evertjan.

=?Utf-8?B?YWRhbQ==?= wrote on 01 jun 2006 in
microsoft.public.inetserver.asp.general:
My goal is to retrieve my local machine's %USERNAME% environment
variable from ASP page.
When I enter http://RemoteServerName/testusername.asp?id=%USERNAME%
directly into the IE Browser URL box, %USERNAME% is repalced with the
local machine ID. However, when I create a
<a href="http://RemoteServerName/testusername.asp?id=%USERNAME%"> get
mahcine id</a> in an html file and use Request.Querystring("id") to
retrieve it in testusername.asp page, it returns "%USERNAME%". I
guess IE browser is smart enough to replace %USERNAME% with the local
environment variable value before sending URL string to the web server
when you type directly into the Browser URL box.

My question is , is there any way to retrieve local machine's
environment variable, %USERNAME% from ASP page?

What do you mean by "local machine"??

Serverside or clientside?
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top