Kushal
Kushal

Reputation: 2791

Get userID of current user logged in from server using asp.net 2.0

How to get userID of current user logged in from server using asp.net vb?

Upvotes: 1

Views: 6944

Answers (2)

Kushal
Kushal

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

Jack Marchetti
Jack Marchetti

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

Related Questions