well first all, thanks for all help i have recive here before, just to make things cleare just cuse i olmoust got someone in trouble on other forum, this is not to make something ilegal or to cuse any spam. is for a privete forum and support i have!!

this is my problem, i am trying to make a gui the is goin to Login to MY FORUM, www.mysite/forum/index.php and will fill out a user and pass that i will provide to my users.
------------------------------------------------------------------------------------
Declare

Private strFilename As String
Private strUpdatename As String
Dim GenElmt As HTMLGenericElement
Dim WithEvents Doc As HTMLDocument
Dim InptElmt As HTMLInputElement
Dim i As Long

------------------------------------------------------------------------------------
i have manage to login, and do what i whant, but i have a big isue with this:
this will rest the webBroser and copi pass and user.

Private Sub Command1_Click()
If user.Text = "" Or pass.Text = "" Then
MsgBox "Necesitas Estar Registrado en El Foro Poner tu User y Pass en El Campo de Login"
Else
    WebBrowser1.navigate "http://www.mysite.com/forum/"
    Text1.Text = WebBrowser1.LocationURL
    lblstatus.Caption = "Datos Copiados...."
    cmdlogin.Visible = True
End If
End Sub

------------------------------------------------------------------------------------
this will make the code for the login and serch for my vb_login_username and vb_login_password. and also will select the remember me so the cookie stay login.

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    'If Text3.Text = WebBrowser1.Document.All("FONT") Then
'Text1.Text = WebBrowser1.LocationURL
    Set Doc = WebBrowser1.Document
    If URL = "http://www.mysite.com/black/index.php" Then
        '~~> Fill UserName
        WebBrowser1.Document.All("vb_login_username").Value = user.Text
        DoEvents
        '~~> Fill Password
        WebBrowser1.Document.All("vb_login_password").Value = pass.Text
        DoEvents
        '~~> Select Remember Me
        WebBrowser1.Document.All("cookieuser").Click
    End If
    'End If
End Sub

------------------------------------------------------------------------------------
Login button

Private Sub CmdLogin_Click()
        lblstatus.Caption = "Estas Conectado a mysite.Com...."
        WebBrowser1.Visible = True
        DoEvents
        '~~> Find the "Submit Button"
        For Each GenElmt In Doc.frames.Document.All
            If UCase$(GenElmt.tagName) = "INPUT" Then
                Set InptElmt = GenElmt
                If UCase$(InptElmt.Value) = "LOG IN" Then
                    '~~> Click Button and then exit the loop
                    InptElmt.Click
                    Exit For
            End If
        End If
        Next
End Sub

now this is my problem if user is login still search for the user and pass to copy. now how can i just put a code lets say if vb_login_username and vb_login_password is not present on the index.php just Go! or trhow a msgbox "Yo allready login".

please i have try and try ...please someone can help me out there?

please can someone give me a little hint here...please!!!:S

how can i do a IF on this Code

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    'If Text3.Text = WebBrowser1.Document.All("FONT") Then
'Text1.Text = WebBrowser1.LocationURL
    Set Doc = WebBrowser1.Document
    If URL = "http://www.mysite.com/black/index.php" Then
        '~~> Fill UserName
        WebBrowser1.Document.All("vb_login_username").Value = user.Text
        DoEvents
        '~~> Fill Password
        WebBrowser1.Document.All("vb_login_password").Value = pass.Text
        DoEvents
        '~~> Select Remember Me
        WebBrowser1.Document.All("cookieuser").Click
    End If
    'End If
End Sub

Example:

If WebBrowser1.Document.All("vb_login_username") dosent exist then
MsgBox "You login"
Else
Run The code above and dont repeat next time!

someone please!!

This article has been dead for over six months. Start a new discussion instead.