Windows 应用程序的 'HttpContext.Current.User.Identity' 等效于什么?

What is the equivalent of the 'HttpContext.Current.User.Identity' for a Windows application?

根据我的研究,我认为 HttpContext 不能用于 Windows 应用程序。 我想为我的 Windows 应用程序使用等效的 HttpContext 来实现类似这样的功能,例如:

Dim userName = HttpContext.Current.User.Identity.Name

Environment.Username 应该为当前登录的用户做技巧,WindowsIdentity.GetCurrent() 将为应用程序的线程获取用户。