Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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)

Go Beavs!!!
Posted
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.

Scalf.

Do not want others to know what you have done? Better not have done it anyways.

  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...