Reputation: 3
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
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