Reputation: 2791
How to get userID of current user logged in from server using asp.net vb?
Upvotes: 1
Views: 6944
Reputation: 2791
I got the answer.and thanks for helping me...
Dim strUserId As String
Dim aryUserId As String()
strUserId = HttpContext.Current.Request.LogonUserIdentity.Name
aryUserId = strUserId.Split("\")
Response.write(aryUserId(1))
Upvotes: 0
Reputation: 15754
Are you using ASP.NET Membership Provider? Then it would be Profile.UserId.
Did you create your own membership system?
Are you talking about getting the Windows User? I think you can use:
Request.ServerVariables["LOGON_USER"]
Upvotes: 1