473,657 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

facing a problem

hello
i have started working bye ASP.net but i'm facing a small
problem. i'm trying to get the name of the user who
logedon to the opersating system , i got the computer
name, server name, domain name, and the name of the user
who started the studio.net { ASPNET }. but the one who
logged on to the operating system i was not able to so any
one can help me?
thank you for responding

Nov 18 '05 #1
2 1268
You can get the name of the person logged on to the application with
ASP.NET, but that does not necessarily mean the person logged onto the OS,
as a person can type in a different account when the Windows Authentication
logon pops up. If you need that person, you can use:

private string GetUserNumber()
{
// Set up character(s) to split on
char[] splitChar = @"\".ToCharArra y();

// Split user to get user ID only
string[] user = Request.ServerV ariables["LOGON_USER "].Split(splitCha r);
int userArrayMax = user.Length-1;
// This is designed for lookup of user
return user[userArrayMax];
}

This returns the string of the account logged into the ASP.NET app. The
problem here, as stated, is the person logged onto the computer and the
person logged into the app can be different.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** *************** **********
Think Outside the Box!
*************** *************** *************** *************** **********
"hu************ @hotmail.com" <an*******@disc ussions.microso ft.com> wrote in
message news:03******** *************** *****@phx.gbl.. .
hello
i have started working bye ASP.net but i'm facing a small
problem. i'm trying to get the name of the user who
logedon to the opersating system , i got the computer
name, server name, domain name, and the name of the user
who started the studio.net { ASPNET }. but the one who
logged on to the operating system i was not able to so any
one can help me?
thank you for responding

Nov 18 '05 #2

To display the user logged into the OS, See that the Anonymous user option in the IIS is off and read this value
"HttpContext.Cu rrent.User.Iden tity.Name"
Nov 18 '05 #3

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

Similar topics

1
1398
by: Jitendra Shinde | last post by:
I am facing a problem on Session. Firstly i am getting log in the application and woring with my some windows. now keeping that other window open and now from that main window i am logging out. so it throws me to the login page (as i am logged out). I am also clearing and abandoning the session. also with the FromsAuthentication.SignOut().
22
1858
by: Rajshekhar | last post by:
Hi , i am writing a simple prgm to read a .txt file then store the contents into the array... program as follows: -------------------------- #include<stdio.h> int main() { FILE *fp1;
5
5460
by: CBidwill | last post by:
Hello, I'm a ASP.NET developer with a little experience in IIS but I'm having difficulties getting a little ASP.NET application I wrote up on my home intranet. Here's the details: - I can view the site fine where the application is hosted by browsing http://<machine name>/<application virtual directory> - When going to http://<machine name>/<application virtual directory> on a remote computer, I get paged cannot be displayed. - From the...
3
2248
by: yassinsearch | last post by:
Hi , I am facing problem text direction.(for HEBREW lanaguage) By default the direction of text field is Left to Rignt. Any SRW methods is available to set the reading direction from Right to Left at the field level in the oracle Report ver :10.1.2.0.2. For more clear understand i have attached the screen shot , Note : In FORM we have implemented , problem we are facing in the Reports.
2
2897
by: apoorva.groups | last post by:
Hi I am facing problem while using regexec function. Ex: String = "abc_def_hig" sub string = "def" regexc if I use regexec the it will find the sub string in string and it will return 0. I want to modify the sub string such that it matches only if the
0
1124
by: Dhananjay | last post by:
hi all, I am facing problem in programming.Can anybody please let me know how to solve the problem. I have a link, clicking the link opens a page in which there are some data which is coming from different tables(join realtionship). And some data has to be inserted in that page(textbox) In this page i have 2 buttons send and save. On clicking send button the page content will be sent to the particular email-id. And on clicking save...
1
875
by: arpit6111984 | last post by:
1)if ($table == $ORDER_ALERTS_TABLE) 2){ my $errorMessage; 3) #2nd Command Line Param is AlertId 4) GetOrderNumber($ARGV); 5) eval 6) { 7) my $AutoActionProc = $databaseHandle => (q{ BEGIN ORDERACTIONS.GENERATEORDERACTIONS(:p_actionId, :p_alertId,
0
1302
by: Niks | last post by:
I am facing a very strange problem in my websevice which is working on socket communication. While i am publishing my webservice to the IIS and invoking a method, a data loss problem in occuring. I seems strange because when i am using the .net framework's inbuild application development server that comes along with 2.0 framework,I am not facing this problem. I dont know why it is not working with IIS while it is working with other...
27
17672
by: davidson1 | last post by:
Hai friends..... I am using Compaq Laptop..I used to hear songs most of the time...but suddenly when i open the Windows Media Player to hear the songs..it is not singing..but gives me the following error.... Windows Media Player cannot play the file because there is a problem with your sound device. There might not be a sound device installed on your computer, it might be in use by another program, or it might not be functioning properly....
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
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
8739
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
8513
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
8613
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...
0
7351
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
2740
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
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
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.