Zoopy
Zoopy

Reputation: 3

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

I believe HttpContext cannot be used for Windows application according to my research. I want to use an equivalent of HttpContext for my Windows application to implement something like this, for example:

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

Upvotes: 0

Views: 798

Answers (1)

Syntax Error
Syntax Error

Reputation: 1640

Environment.Username should do the trick for the currently logged in user, WindowsIdentity.GetCurrent() will get the user for the application's thread.

Upvotes: 2

Related Questions