Solved

How can I get the ucrrently login userid and the password?

Posted on 2006-11-06
4
176 Views
Last Modified: 2010-04-16
Thanks.
0
Comment
Question by:lapucca
  • 3
4 Comments
 
LVL 15

Expert Comment

by:ozymandias
ID: 17885170
You can't get the password.
The method of getting the curretly logged in userid depends on the context.
Is this a winforms app or an asp.net app ?
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 17885181
ASP.NET
WindowsIdentity Identity = (WindowsIdentity)HttpContext.Current.User.Identity;

Otherwise, try :

WindowsIdentity Identity = WindowsIdentity.GetCurrent();

Then you can do Identity.Name to get the username.
0
 

Author Comment

by:lapucca
ID: 17885559
Sorry, I'm using vs2005, .net 2.0 running on Win2k and up.  The application is a winForm appl.  Thanks.
0
 
LVL 15

Accepted Solution

by:
ozymandias earned 500 total points
ID: 17885623
OK. Try :

WindowsIdentity Identity = WindowsIdentity.GetCurrent();
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Switching Visual Studio 2015 to normal debug display 3 42
How do I hide MVVM menu items in WPF/XAML? 1 31
WPF user control poped up from a window 1 35
WPF Select Items 3 24
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question