account the App is running under

  • Thread starter Thread starter Wei
  • Start date Start date
W

Wei

Hi,

Is there anyway(programatically) to find out under what
account the current application is running?

Thanks,

Yu
 
You may want to look at the System.Security.Principal namespace:

WindowsIdentity wi = WindowsIdentity.GetCurrent();
Console.WriteLine(wi.Name);

that gave me the name of the user (DOMAIN\USERNAME). Is this what you
needed?

marko
 
This is exactly what I need. Thank you Marko.
-----Original Message-----
You may want to look at the System.Security.Principal namespace:

WindowsIdentity wi = WindowsIdentity.GetCurrent();
Console.WriteLine(wi.Name);

that gave me the name of the user (DOMAIN\USERNAME). Is this what you
needed?

marko




.
 
Back
Top