Solved

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

Posted on 2006-11-06
4
172 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now