kcwallace Posted October 25, 2005 Posted October 25, 2005 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? 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) Quote Go Beavs!!!
Administrators PlausiblyDamp Posted October 26, 2005 Administrators Posted October 26, 2005 Does your website require the user to be logged on? If not then they will not have a user name. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
scalf Posted October 26, 2005 Posted October 26, 2005 Yes, for that you need to check IIS to see if anonymous connections are allowed, if so you should disable it and allow only Windows Authentication. Quote Scalf. Do not want others to know what you have done? Better not have done it anyways.
kcwallace Posted April 17, 2006 Author Posted April 17, 2006 Thank you for your help Quote Go Beavs!!!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.