473,320 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1256
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 = @"\".ToCharArray();

// Split user to get user ID only
string[] user = Request.ServerVariables["LOGON_USER"].Split(splitChar);
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*******@discussions.microsoft.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.Current.User.Identity.Name"
Nov 18 '05 #3

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

Similar topics

1
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...
22
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
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...
3
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...
2
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....
0
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...
1
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{...
0
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....
27
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.