I found that both My.User.Name and My.User.CurrentPrincipal.Identity.Name return the Windows login ID for the user to log on to the computer. However, is there a difference between the two? Will there ever be a case when they do not return the same value?
The information on the My.UserMSDN page best describes these values and when they differ.
My.User
Finally. The biggest difference between Windows and web applications.
Windows , CurrentPrincipal. - , , .
System.Web.UI.Page, :
System.Web.UI.Page
Me.User
Me.Context.User
Me.Context
HttpContext.Current
, .
Oops! . My " " , User . - .
My
User
Source: https://habr.com/ru/post/1763812/More articles:How to get value from jquery in c # user control? - javascriptOptimizing C ++ Code for Performance - c ++What makes usage volatile when using java.util.concurrent.Concurrent * containers? - javaRaise an event when all asynchronous method calls are completed - c #XWindows terminal emulation as a component of .NET Winform - .netnunit loading loading exe - exeRegistering with vendor classes in CakePHP - cakephpКак читать внешний XML файл из jar - javaIs it possible to change the default output cache settings - cachingШаблоны Django разделяют текст на fullstop - djangoAll Articles