SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Senior Member
    Join Date
    May 2001
    Location
    Lahore, Punjab, Pakistan
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Getting User name logged in?

    Hello,I posted it previously mistakenly against QA Training.The Problem is
    I want to get user name (both on host and target) and write it in .res file against the first entry Machine.
    Suppose if the machine name is PC-001 and user name is usr1 then entry should appear as
    Machine:PC-001(usr1);
    Hoping to help as before.


    ------------------

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting User name logged in?

    Stuff GetMachineName() in the above code.



    ------------------

  3. #3
    Senior Member
    Join Date
    May 2001
    Location
    Lahore, Punjab, Pakistan
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting User name logged in?

    Thanks GodKnows!
    GetMachineName() is actually returning local if we get the host name.Actually i want the name of the machine.If the machine is target machine then we don't need of it as we can not connect until we know it.

    ------------------

  4. #4
    Junior Member
    Join Date
    Oct 2000
    Location
    Cambridge MA USA
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting User name logged in?

    Well, if you are running on Windows (NT and 2K for sure, probably true on the others), you can use
    We're using this call and it seems to work.




    ------------------

  5. #5
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting User name logged in?

    Just curious.

    Do you need to set your environment variable in system|control panel before using this function??

    Or

    There is a set system environment variable that we can access? Where to find them in this case?

    ------------------

  6. #6
    Junior Member
    Join Date
    Oct 2000
    Location
    Cambridge MA USA
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting User name logged in?

    No, you don't need to set anything in your environment before using this; I think it's an artifact of setting up the network (Control Panel:Network).

    Interesting: on my NT system, I don't see COMPUTERNAME in the Environment section at all; but when I do a SET (*) from the DOS prompt, it shows up! And Silk can find it also. This also makes me think the environment variable is set by the system during network configuration.

    (*) Note that this is just the command SET on a line; I'm explicitly not setting the environment variable from the prompt.


    [This message has been edited by NigelC (edited 06-12-2001).]

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:11 AM.

Copyright BetaSoft Inc.