HighTechTalks DotNet Forums  

Getting windows user-name without domain name

ASP.net Security microsoft.public.dotnet.framework.aspnet.security


Discuss Getting windows user-name without domain name in the ASP.net Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Patrick
 
Posts: n/a

Default Getting windows user-name without domain name - 12-07-2007 , 07:26 AM






With .Net 2 SmartClient published/deployed over ClickOnce over IIS, is there
a property like System.Security.Principal.WindowIdentity.GetCurren t().Name
which would get me the logged on userID (without the DOMAIN\)?


Reply With Quote
  #2  
Old   
Joe Kaplan
 
Posts: n/a

Default Re: Getting windows user-name without domain name - 12-07-2007 , 10:20 AM






No, you have to parse it out or pass the NT name to a conversion function
which will convert it to a different format. Parsing it out would be
easier.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Patrick" <patl (AT) reply (DOT) newsgroup.msn.com> wrote

Quote:
With .Net 2 SmartClient published/deployed over ClickOnce over IIS, is
there
a property like System.Security.Principal.WindowIdentity.GetCurren t().Name
which would get me the logged on userID (without the DOMAIN\)?




Reply With Quote
  #3  
Old   
Nikolay Podkolzin
 
Posts: n/a

Default RE: Getting windows user-name without domain name - 12-14-2007 , 10:23 AM



string userName = Environment.UserName;

"Patrick" wrote:

Quote:
With .Net 2 SmartClient published/deployed over ClickOnce over IIS, is there
a property like System.Security.Principal.WindowIdentity.GetCurren t().Name
which would get me the logged on userID (without the DOMAIN\)?


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.