Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > facing a problem

Reply
Thread Tools

facing a problem

 
 
hussein_hariri@hotmail.com
Guest
Posts: n/a
 
      12-26-2003
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

 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      12-26-2003
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!
************************************************** ********************
"(E-Mail Removed)" <(E-Mail Removed)> wrote in
message news:037b01c3cbcd$4ba95a70$(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?U2h5YW0gUmVtZWxsYQ==?=
Guest
Posts: n/a
 
      12-27-2003

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"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Facing problem while using Wizards with Project Templates !!!!! Anubhav Jain ASP .Net 0 03-20-2006 09:16 AM
Problem Facing in Server Side Validation. msnews.microsoft.com ASP .Net 3 05-21-2005 04:25 PM
Facing Session Timeout problem Hema S via DotNetMonster.com ASP .Net 1 04-21-2005 08:58 AM
Facing problem in loading data from CArchive in VCDotNet. Konark Khera ASP .Net 0 03-22-2005 11:24 AM
Urgent Pls: Facing problem in reading Log information from Log file, created by IIS Amratash ASP .Net 0 04-13-2004 09:08 AM



Advertisments