CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge -> Programming

 How to get UserID from Logon_User

Print topic Send  topic

Author Message
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.
View profile  Send private message
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

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.