kcwallace
Well-known member
It is my understanding that the below code is the best way to determine a users network name in an ASP.Net page. However when I run it I get an empty string. Can someone help?
Code:
Imports System.Security
Imports System.Security.Principal.WindowsPrincipal
Dim logon_str As String = HttpContext.Current.User.Identity.Name
Dim str_int As Integer
str_int = logon_str.IndexOf("\")for some reason it this forum is dropping the "back slash". It is there in the real code
logon_name = HttpContext.Current.User.Identity.Name.Substring(str_int + 1)