I've found that both My.User.Name and My.User.CurrentPrincipal.Identity.Name both return the Windows login ID of the user logged in to the PC. However, is there a difference between the two? Will there ever be a case where they won't return the same value?
OP say `My` which is very different than `Me`
JaredPar
2010-09-08 14:14:11
+2
A:
The information on the My.User
MSDN page has the best summary of these values and when they differ
In summary though. The biggest difference occurs between Windows and Web Applications.
For Windows applications, this property provides the same functionality as the CurrentPrincipal property. For Web applications, this property provides the same functionality as the User property of the object returned by the Current property.
JaredPar
2010-09-08 14:16:45
Thanks. Since I'm using this in a Windows application, I can rest assured that they are the same - and that I can use the shorter of the two :)
HardCode
2010-09-08 15:12:55