Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-11-06
4
Medium Priority
?
182 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 2000 total points
ID: 17885623
OK. Try :

WindowsIdentity Identity = WindowsIdentity.GetCurrent();
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
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 anti-spam), the admin…

971 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