Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

peterpruimboom (Programmer) (OP)
16 Mar 03 9:42
Hello,

When a user must login into my programm I woul'd like to use the Windows username an password of the currently logged in user. I know that the username can be found by using the GetUserName function but I don't have a clue how to check the password. I understand that the password on itself is not retrievable but there must be a way to do this. This because I've seen it work with an application.

Can anyone help me with this?

Thanks, Peter.
MickTheBelgian (Programmer)
1 Apr 03 7:50
In your dreams, pal.  Can you see the spyware comming out sending userID and password back to the authors?  Passwords are evaluated with a one-way algorithm:  if X is the password then f(X) is calculated and compared to an f(X) stored in the SAM file.  Knowing f(X) does not allow you to recalculate X.  Why would you need the password anyway?
peterpruimboom (Programmer) (OP)
1 Apr 03 9:21
I'm not interested in the password but want to check of a given password equals the windows logon password. The UserID I can get (in normal format) with the GetUserName function in the windows API.
JustinEzequiel (Programmer)
1 Apr 03 20:25
forgot where I got this but it worked on my Win98 box.
does not work on my WinXP box though.

Private Declare Function WNetVerifyPassword Lib "mpr.dll" Alias _
    "WNetVerifyPasswordA" (ByVal lpszPassword As String, _
    ByRef pfMatch As Long) As Long

Private Function VerifyWindowsLoginUserPassword _
        (ByVal Password As String) As Boolean
    Dim rtn As Long, Match As Long
    rtn = WNetVerifyPassword(Password, Match)
    If rtn Then
        VerifyWindowsLoginUserPassword = False
    Else
        VerifyWindowsLoginUserPassword = (Match <> 0)
    End If
    Debug.Print rtn, Match
End Function

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close