473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

retrieve local machine environment variable from ASP page

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
2 3603
=?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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Carlos Gomez | last post by:
Question 1 Is there a way to execute a page, retrieve some information out of it and then present it in my page? example: The user access MyPage.asp MyPage.asp <somehow, internally> calls...
0
by: pwldev | last post by:
Sorry if this isn't a good place for this question. I have a problem with losing cookie values whenever a user's local machine date/time is behind the date & time of the IIS machine. The login...
0
by: Mr. Land | last post by:
Hello. I'm having trouble creating a new Web project using VS .NET 2003 on the local default web. I've done a lot of research about this and found a lot of suggestions, but none of them seem to...
3
by: Robin Tucker | last post by:
I'm fetching a list of SQL servers on a domain using a function that returns strings, including "(local)" for the local machine (if it has an SQL server on it). Now, presumably in a different...
23
by: Timothy Madden | last post by:
Hello all. I program C++ since a lot of time now and I still don't know this simple thing: what's the problem with local functions so they are not part of C++ ? There surely are many people...
6
by: Brad | last post by:
I have a win2003 server workstation with multiple webs, each web has it's own ip address. In VS2005, if I select to open an existing web site, select Local IIS, the dialog correctly displays a...
6
by: Michael | last post by:
I am running an application that requires "Full Trust" which is declared in the assembly. How do I trap for the System.Security.Policy.PolicyException that is raised by a local machines CAS if...
0
by: Salim Fadhley | last post by:
I'm looking for a method to retrieve a Windows Domain name (not a DNS Domain name). I know this can be done by simply reading an environment variable, however on the machines I need to work with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.