Santhosh Kumar
Santhosh Kumar

Reputation: 199

How to find logged in user from Windows Registry?

am developing a windows store 8.1 app using C# and xaml.

In my app I want to find logged in user name from Windows Registry.

How can I get that from C# code?

Upvotes: 1

Views: 10534

Answers (1)

Hans Olsson
Hans Olsson

Reputation: 55059

You can find the user name in HKEY_CURRENT_USER\Volatile Environment\USERNAME. However, I'm pretty sure you won't be able to access this from a Windows Store App.

I'd suggest looking at the UserInformation.GetDomainNameAsync method or other methods in the UserInformation class instead.

Upvotes: 5

Related Questions