retrieve local machine environment variable from ASP page

Discussion in 'ASP General' started by adam, Jun 1, 2006.

  1. adam

    adam Guest

    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
     
    adam, Jun 1, 2006
    #1
    1. Advertising

  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" <> wrote in message
    news:...
    > 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
     
    Ray Costanzo [MVP], Jun 1, 2006
    #2
    1. Advertising

  3. adam

    Evertjan. Guest

    =?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)
     
    Evertjan., Jun 1, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. karim
    Replies:
    1
    Views:
    780
    George Ter-Saakov
    Jun 26, 2003
  2. Replies:
    5
    Views:
    676
  3. chandan
    Replies:
    1
    Views:
    381
    Naraendirakumar R.R.
    Jan 8, 2008
  4. chandan
    Replies:
    1
    Views:
    318
  5. David Winter

    Retrieve cookie content /w local page/script?

    David Winter, Dec 2, 2007, in forum: Javascript
    Replies:
    0
    Views:
    89
    David Winter
    Dec 2, 2007
Loading...

Share This Page