By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,488 Members | 2,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,488 IT Pros & Developers. It's quick & easy.

retrieve local machine environment variable from ASP page

P: n/a
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!!!
--
-adam
Jun 1 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
=?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?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 1 '06 #2

P: n/a
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

"adam" <ad**@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
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!!!
--
-adam

Jun 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.