473,672 Members | 2,497 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting the windows username in an ASP.NET application

Hi I want to pick up the name of the logged in windows user for my ASP.NET
application.

When I use

System.Environm ent.UserName

i get ASPNET which is ofcourse not what I want

when I try User.Identity.N ame I get an emtry string which is also not what I
want

Is there a way of determining the windows user from and ASP.NET application

Thanks in advance
Nov 22 '05 #1
2 8262
OK solved - User.Identity.n ame does work so long as I change the directory
security settings on my web server

"hplloyd" wrote:
Hi I want to pick up the name of the logged in windows user for my ASP.NET
application.

When I use

System.Environm ent.UserName

i get ASPNET which is ofcourse not what I want

when I try User.Identity.N ame I get an emtry string which is also not what I
want

Is there a way of determining the windows user from and ASP.NET application

Thanks in advance

Nov 22 '05 #2
string userName = Request.ServerV ariables["AUTH_USER"];

Of course, this only works if Windows Authentication is enabled for your
site (and not anonymous access).

HTH, Jakob.

"hplloyd" wrote:
Hi I want to pick up the name of the logged in windows user for my ASP.NET
application.

When I use

System.Environm ent.UserName

i get ASPNET which is ofcourse not what I want

when I try User.Identity.N ame I get an emtry string which is also not what I
want

Is there a way of determining the windows user from and ASP.NET application

Thanks in advance

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8847
by: Newbie | last post by:
I am a newsbie to ASP but need to get a script together that will insert the Windows Username of the local machine into an access database. I get the errors from my code below, can anyone help me please as I've hit a deadend: Thanks CODE:
2
9542
by: Steph | last post by:
I am working on a Windows Forms App. I have attached a standard UnhandledExceptionEventHandler to the current domain to catch unexpected errors. In my application, when I trigger an unhandled error, my handler does not get hit - I get the standard ugly run time error. The strange thing is, I tried the exact same code in a new, windows forms application, and when I trigger an unhandled exception, the code works fine (the JIT compiler...
8
2954
by: Jonathan Dixon | last post by:
I am developing an intranet and was wondering, when a user logs on is there a way to get the username of the windows account in asp.net. I have tried the following but they return the worker process username e.g DOMAIN\ASPNET Can somone suggest a way or provide some code the get the username of the logged on account in windows Thanks
8
3945
by: Raj Thakkar | last post by:
Hi, I am currenty working on a site for intranet. I have a user control in the header of every page that will be displayed only if people with certain username are surfing the site. These lists of usernames is stored on the server side in a xml based file So what I am doing at the moment is inside the user control pageload method, i get the username of the current person logged in using HttpContext.Current.User.Identity.Name and if the...
2
1195
by: Child | last post by:
my application needs to retrieve windows username - anon authentication is OFF, auth mode in web.config is "windows". I get machine name with Dim ident As WindowsIdentity = WindowsIdentity.GetCurrent() txtUser.Text = ident.Name What do i need to find username?
5
5469
by: nikou_70 | last post by:
I have a problem with ("auth_user") in asp,I try to use windows username and password in asp page for limitation user access to pages, but this server variable returns empty string, can you help me ,I appreciate it.
8
16674
by: Bruno Barros | last post by:
Hey there. I'm currently working on an intranet, and would like to know how I can get the windows usernames of the visitors. You can get their IP with $_SERVER; But what about their Windows Username? Is there any way of doing so? Through the Intranet?
1
2461
by: hemel | last post by:
I am going developed a web site where all user have registered with their windows username. So I want to USER NAME fild automically fillup with windows username. How can i do this? Is it possible with Java Script?
4
4176
by: orajat | last post by:
hi, I'm trying to pull the windows username with jscript and save it to ms access field in a table, but it does not work. it does show the alert with the name of the user but does not save it to the ms access field. here i steh code that i'm using. please help <SCRIPT type=text/javascript> <!-- var WinNetwork = new ActiveXObject("WScript.Network"); alert(WinNetwork.userName); var adOpenDynamic = 2;
8
12547
by: tiijnar | last post by:
Hi, To get windows username Im using the following code. public class GetWindowUsername { public String getUser() { String userName = System.getProperty("user.name"); System.out.println("Window's Username: "+userName); return userName; }
0
8930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8828
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8605
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8677
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6238
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4417
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2819
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.