Thread.CurrentPrincipal.Identity.Name is empty from WPF

后端 未结 3 1799
天涯浪人
天涯浪人 2020-12-28 08:30

EDIT

The simple question is, how can I get Thread.CurrentPrincipal.Identity.Name to have the current user logon in WPF?

3条回答
  •  长发绾君心
    2020-12-28 09:02

    Try

    System.Security.Principal.WindowsIdentity.GetCurrent().Name;
    

    or:

    Environment.UserName
    

提交回复
热议问题