Thread: Log In System

Results 1 to 8 of 8
  1. #1
    tynab's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Posts
    382
    Reputation
    10
    Thanks
    1,167
    My Mood
    Blah

    Log In System

    Code:
    Code:
       WebBrowser1.Document.GetElementById("vb_login_username").SetAttribute("value", TextBox2.Text)
            WebBrowser1.Document.GetElementById("vb_login_password").SetAttribute("value", TextBox3.Text)
            WebBrowser1.Document.GetElementById("submit").InvokeMember("click")
    Code:
    Code:
    WebBrowser1.Navigate("somesite/forum")
    I need help wit log in button :
    Code:

    Code:
     WebBrowser1.Document.GetElementById("submit").InvokeMember("click")
    submit (thats log in button ) is not working so i need little help here


    Hassan's Edit: Advertisement Removed
    Last edited by Hassan; 04-28-2012 at 03:18 AM. Reason: Advertisement Removed

  2. #2
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by tynab View Post
    bump need help
    On WebBrowser's DocumentComplete Event, add the following code:

    Code:
    For Each Element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("form")
                For Each NestedElement As HtmlElement In Element.GetElementsByTagName("input")
                    If NestedElement.OuterHtml.Contains("vb_login_username") Then
                        NestedElement.SetAttribute(NestedElement.Name, TextBox2.Text)
                    End If
                    If NestedElement.OuterHtml.Contains("vb_login_password") Then
                        NestedElement.SetAttribute(NestedElement.Name, TextBox3.Text)
                    End If
                    If NestedElement.OuterHtml.Contains("type=submit") Then
                        NestedElement.InvokeMember("click")
                        Exit For
                    End If
                Next
            Next
    Also, be sure to suppress error messages of the webpage by adding the following line on form's load event or before you navigate to the forum's url:

    Code:
    WebBrowser1.ScriptErrorsSuppressed = True
    Last edited by Hassan; 04-29-2012 at 01:29 AM.

  3. The Following User Says Thank You to Hassan For This Useful Post:

    tynab (04-29-2012)

  4. #3
    tynab's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Posts
    382
    Reputation
    10
    Thanks
    1,167
    My Mood
    Blah
    Quote Originally Posted by Hassan View Post


    On WebBrowser's DocumentComplete Event, add the following code:

    Code:
    For Each Element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("form")
                For Each NestedElement As HtmlElement In Element.GetElementsByTagName("input")
                    If NestedElement.OuterHtml.Contains("vb_login_username") Then
                        NestedElement.SetAttribute(NestedElement.Name, TextBox2.Text)
                    End If
                    If NestedElement.OuterHtml.Contains("vb_login_password") Then
                        NestedElement.SetAttribute(NestedElement.Name, TextBox3.Text)
                    End If
                    If NestedElement.OuterHtml.Contains("type=submit") Then
                        NestedElement.InvokeMember("click")
                        Exit For
                    End If
                Next
            Next
    Also, be sure to suppress error messages of the webpage by adding the following line on form's load event or before you navigate to the forum's url:

    Code:
    WebBrowser1.ScriptErrorsSuppressed = True
    Tnx but it works only like this
    Code:
     For Each Element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("form")
                For Each NestedElement As HtmlElement In Element.GetElementsByTagName("input")
                    WebBrowser1.Document.GetElementById("vb_login_username").SetAttribute("value", TextBox1.Text)
                    WebBrowser1.Document.GetElementById("vb_login_password").SetAttribute("value", TextBox2.Text)
                    If NestedElement.OuterHtml.Contains("type=submit") Then
                        NestedElement.InvokeMember("click")
                        Exit For
                    End If
                Next
            Next
            WebBrowser1.ScriptErrorsSuppressed = True

  5. #4
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by tynab View Post
    Tnx but it works only like this
    Code:
     For Each Element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("form")
                For Each NestedElement As HtmlElement In Element.GetElementsByTagName("input")
                    WebBrowser1.Document.GetElementById("vb_login_username").SetAttribute("value", TextBox1.Text)
                    WebBrowser1.Document.GetElementById("vb_login_password").SetAttribute("value", TextBox2.Text)
                    If NestedElement.OuterHtml.Contains("type=submit") Then
                        NestedElement.InvokeMember("click")
                        Exit For
                    End If
                Next
            Next
            WebBrowser1.ScriptErrorsSuppressed = True
    Yeah, haven't done anything browser related in a while so forgot the way it is done.

    Anyways, marked solved. No more posting.

  6. #5
    tynab's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Posts
    382
    Reputation
    10
    Thanks
    1,167
    My Mood
    Blah
    Quote Originally Posted by Hassan View Post


    Yeah, haven't done anything browser related in a while so forgot the way it is done.

    Anyways, marked solved. No more posting.
    how to put now when someone log in correctly then something happens ?

  7. #6
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by tynab View Post
    how to put now when someone log in correctly then something happens ?
    You need to put a check on Browser's DocumentLoad event that if the page source contains some kind of greeting, then it means you are logged in.

    E.g:

    Code:
    If WebBrowser1.DocumentTex*****ntains("Hello Username") Then
    'Logged In. Do some stuff here...
    Else
    'Haven't Logged In !'
    End If
    You need to replace Hello Username with something that validates that the user has logged in.

  8. #7
    tynab's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Posts
    382
    Reputation
    10
    Thanks
    1,167
    My Mood
    Blah
    Quote Originally Posted by Hassan View Post


    You need to put a check on Browser's DocumentLoad event that if the page source contains some kind of greeting, then it means you are logged in.

    E.g:

    Code:
    If WebBrowser1.DocumentTex*****ntains("Hello Username") Then
    'Logged In. Do some stuff here...
    Else
    'Haven't Logged In !'
    End If
    You need to replace Hello Username with something that validates that the user has logged in.
    Tnx , i changed something and now it works , tnx !

  9. #8
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by tynab View Post
    Tnx , i changed something and now it works , tnx !
    No problem.

Similar Threads

  1. [First Release] Michael Jackson's MPGH Combat Arms Tools (Includes Log-In System!)
    By Gasps Its Michael Jackson in forum Combat Arms Spammers, Injectors and Multi Tools
    Replies: 5
    Last Post: 07-11-2010, 02:23 PM
  2. Simple Log-In System For Cho0bs
    By Jimmy VB in forum Programming Tutorials
    Replies: 3
    Last Post: 07-09-2010, 03:40 PM
  3. [Release] CA Chat + PHP Log in System
    By Pixie in forum Combat Arms Hacks & Cheats
    Replies: 24
    Last Post: 12-13-2009, 11:36 PM
  4. System Hacker For Gunz
    By gameking85 in forum Gunz Hacks
    Replies: 11
    Last Post: 02-09-2006, 11:57 AM
  5. Boot up Windows before you even log in.
    By Dave84311 in forum General
    Replies: 6
    Last Post: 01-15-2006, 09:10 PM