mramirez18
Posts: 56
|
Posted: 06/26/2006, 6:33 PM |
|
I am using NT Authentication, and I need to validate theLOGON_USER with UserID in table. Has anyone had success with this.
|
|
|
Abs
|
Posted: 08/18/2006, 2:04 AM |
|
HI,
HttpContext.Current.User.Identity.Name will return the curent logged on user, but on IIS you must have annonymous access unticked for the correct user name to get passed to the application.
Here is an example to get the user and store it in a variable called userName and then seperate the doimain name and username.
Dim userName() As String = Split(HttpContext.Current.User.Identity.Name,"\")
Here I am now storing the username part into a session variable so it is accessable to other pages:
HttpContext.Current.Session("currentUser") = userName(1).ToUpper
------------------------------------------
Domain part = userName(0)
Username part = userName(1)
------------------------------------------
Note: this is VB.Net
Good luck
Abs
|
|
|
|