locked
Current logged in user RRS feed

  • Question

  • Is there a way to detect the user account that's logged in (and hence running the gadget)? I'm wanting to interact with the user's home directory but can't find out what to detect it from the gadget.
    Tuesday, February 20, 2007 10:58 AM

Answers

  • var currentuser = System.Environment.getEnvironmentVariable("UserName") 

    You can use other variables like that too, like temp to find the temp folder. I've actually created a gadget which is on the gallery to show the current logged on user and their user tile aswell.

    Tuesday, February 20, 2007 1:29 PM

All replies

  • var currentuser = System.Environment.getEnvironmentVariable("UserName") 

    You can use other variables like that too, like temp to find the temp folder. I've actually created a gadget which is on the gallery to show the current logged on user and their user tile aswell.

    Tuesday, February 20, 2007 1:29 PM
  • Yeah I thought of that when I went to bed. I was lying there and it just clicked that I can use the environment variables.

    Thanks none the less :)
    Tuesday, February 20, 2007 11:46 PM
  • I know that this is an old post but what language is "var currentuser = System.Environment.getEnvironmentVariable("UserName") "?
    Friday, April 26, 2013 7:49 PM
  • Gadget specific JScript.
    Saturday, April 27, 2013 12:49 AM