Question

I have a proof of concept project and as part of it I need to identify the best way to display the User Name(the person logged on the PC) on the ToolWindow. The idea is to get this from the client and not the server or service. The package is to be VS 2008 first, then I need to do it in VS 2010 next. I am using WPF as the preferred UI. I am about a week into learning the ins and outs of VSX and appreciate all guidance. Thanks, Danny

Was it helpful?

Solution

Ok, I got the answer. Very simple,

System.Security.Principal.WindowsIdentity currentUser = System.Security.Principal.WindowsIdentity.GetCurrent();

string loginName = currentUser.Name; tb1.Text = loginName;

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top