CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Posts
    3

    How to get current username and password

    Hi, everyone:
    Who can tell me how to get current logon user name and passwor programmablly under Windows NT or Windows 95?
    Please tell me as soon as possible!
    Thank you!
    clara


  2. #2
    Guest

    Re: How to get current username and password

    You can get the name of the logged in user via the NetUserGetInfo() API call, but there is no way to get the user's password programmatically. This is by design, and is a fundamental security restriction of almost every OS known to man. You can, however, test a potential password to see if it is the "real" one, so you could conceivably ask the user for their password, then check it to make sure they didn't lie to you...

    Cheers!
    Humble Programmer
    ,,,^..^,,,


  3. #3
    Guest

    Re: How to get current username and password

    Hello


    How can you test if the user specified correct password.
    Can you actually login programmaticly ?




  4. #4
    Guest

    Re: How to get current username and password

    Read Micro$oft Knowlege Base article Q180548 "HOWTO: Validate User Credentials on Microsoft WinNT and Win95". It even has a snippet of sample code to point you in the right direction.

    Cheers!
    Humble Programmer
    ,,,^..^,,,


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured