Thread.CurrentPrincipal.Identity.Name is empty from WPF

后端 未结 3 1798
天涯浪人
天涯浪人 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:22

    This also worked for me:

    Thread.CurrentPrincipal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
    

提交回复
热议问题