Author: sunlord_clave | Posted on: 11/11/2008 3:50:02 AM | Views : 244

 2 questions:
 1) When you do http.context.current.user.identity is there a way of just getting the "userID" and not the domain as well? For example when I do that I get DOMAIN/user. How can I just get the user? I've been doing this, but is there a better way?:
 
Dim userID As String
Dim User As System.Security.Principal.IPrincipal
User = System.Web.HttpContext.Current.User
userID = User.Identity.Name

Dim StrUser As String
StrUser = userID

Do Until InStr(StrUser, "\") = 0
StrUser = Mid$(StrUser, InStr(StrUser, "\") + 1)
userID = StrUser
userID.ToLower()
Loop &n ...

Go to the complete details ...