Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem with SqlConnection 4 160
How to iterate over object and get property name and value 4 26
SQL Login 17 40
How can my static class become undefined?? 8 18
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 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

16 Experts available now in Live!

Get 1:1 Help Now