Visual Basic 2010: Problem with WebSite Login

11/09/2012 20:06 Der Anbieter#16
Quote:
Originally Posted by boxxiebabee View Post
Are you fucking stupid?! You need the ID and not the name.
Don't be that harsh, we all were beginners once :)

@OP:

Maybe if you'd read out the source code and find the particular area of the code.
11/09/2012 21:46 24terminetor96#17
NOOOOOOOOOOOOOOOOOO If you/i usethe id the program give me and error! Test...
And so all button that i analyze haven't also the id...
11/10/2012 00:41 'Heaven.#18

i didnt tested it, but i think this will work
11/10/2012 08:06 boxxiebabee#19
Quote:
Originally Posted by Der Anbieter View Post
Don't be that harsh, we all were beginners once :)
Sorry, but I've told him already 5 times that he need the ID and not the name.. >.>
11/10/2012 11:35 dakata783#20
I can show you by TeamViewer - skype:jordan.velikov3
11/10/2012 16:43 24terminetor96#21
It work for input username and password but for button when i try to found the name there isn't...and it don't go
11/10/2012 17:07 'Heaven.#22
Try this...

Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("https://accounts.google.com/ServiceLogin?hl=de&continue=http://www.google.it/")
        WebBrowser1.ScriptErrorsSuppressed = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        WebBrowser1.Document.GetElementById("EMail").Innertext = Textbox1.Text
        WebBrowser1.Document.GetElementById("Passwd).Innertext = Textbox2.Text
        WebBrowser1.Document.GetElementById("signIn").InvokeMember("click")

    End Sub

End Class
11/10/2012 17:40 Der Anbieter#23
Quote:
Originally Posted by 'Heaven. View Post
Try this...

Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("https://accounts.google.com/ServiceLogin?hl=de&continue=http://www.google.it/")
        WebBrowser1.ScriptErrorsSuppressed = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        WebBrowser1.Document.GetElementById("EMail").Innertext = Textbox1.Text
        WebBrowser1.Document.GetElementById("Passwd).Innertext = Textbox2.Text
        WebBrowser1.Document.GetElementById("signIn").InvokeMember("click")

    End Sub

End Class
He wants to make it for facebook, not google.
11/10/2012 17:44 master_oli#24
i´m not a VB.Net code but this you must use in C#
Code:
HtmlElementCollection elc = this.webBrowser1.Document.GetElementsByTagName("input");
                foreach (HtmlElement el in elc)
                {
                        if (el.GetAttribute("value") == "Anmelden")
                        {
                            el.InvokeMember("click");
                        }
                    }
because the Id of the Submit butten change every load the webseit new
I hope this help you away
11/10/2012 17:52 'Heaven.#25
Try this...

Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("http://www.facebook.com/index.php?stype=lo&lh=Ac-CgxyyaJvgDn2I")
        WebBrowser1.ScriptErrorsSuppressed = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim tmp1 As String = WebBrowser1.DocumentText.Replace(Chr(34), "")
        Dim tmp() As String = Split(tmp1, "loginbutton")
        Dim tmp2() As String = Split(tmp(1), ">")
        Dim tmp3() As String = Split(tmp2(0), "for=")
        WebBrowser1.Document.GetElementById(tmp3(1)).InvokeMember("click")
        WebBrowser1.Document.GetElementById("email").Innertext = Textbox1.Text
        WebBrowser1.Document.GetElementById("pass).Innertext = Textbox2.Text
        Webbrwoser1.Document.GetElementById("default_persistent").InvokeMember("click")
        Webbrowser1.Document.GetElementById(tmp3(1)).Invokemember("click")
    End Sub

End Class
Quote:
Originally Posted by master_oli View Post
i´m not a VB.Net code but this you must use in C#
Code:
HtmlElementCollection elc = this.webBrowser1.Document.GetElementsByTagName("input");
                foreach (HtmlElement el in elc)
                {
                        if (el.GetAttribute("value") == "Anmelden")
                        {
                            el.InvokeMember("click");
                        }
                    }
because the Id of the Submit butten change every load the webseit new
I hope this help you away
this is not good..Only working for german lang
11/11/2012 20:12 24terminetor96#26
Quote:
Originally Posted by 'Heaven. View Post
Try this...

Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("http://www.facebook.com/index.php?stype=lo&lh=Ac-CgxyyaJvgDn2I")
        WebBrowser1.ScriptErrorsSuppressed = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim tmp1 As String = WebBrowser1.DocumentText.Replace(Chr(34), "")
        Dim tmp() As String = Split(tmp1, "loginbutton")
        Dim tmp2() As String = Split(tmp(1), ">")
        Dim tmp3() As String = Split(tmp2(0), "for=")
        WebBrowser1.Document.GetElementById(tmp3(1)).InvokeMember("click")
        WebBrowser1.Document.GetElementById("email").Innertext = Textbox1.Text
        WebBrowser1.Document.GetElementById("pass).Innertext = Textbox2.Text
        Webbrwoser1.Document.GetElementById("default_persistent").InvokeMember("click")
        Webbrowser1.Document.GetElementById(tmp3(1)).Invokemember("click")
    End Sub

End Class
But if in wbebrowser navigate in the page [Only registered and activated users can see links. Click Here To Register...] the code will be the egual code?
11/11/2012 21:58 'Heaven.#27
Yes, this code it working for all facebooks
11/12/2012 23:21 24terminetor96#28
Can you explain me this part of the code?
Quote:
Dim tmp1 As String = WebBrowser1.DocumentText.Replace(Chr(34), "")
Dim tmp() As String = Split(tmp1, "loginbutton")
Dim tmp2() As String = Split(tmp(1), ">")
Dim tmp3() As String = Split(tmp2(0), "for=")
WebBrowser1.Document.GetElementById(tmp3(1)).Invok eMember("click")
WebBrowser1.Document.GetElementById("email").Inner text = Textbox1.Text
WebBrowser1.Document.GetElementById("pass).Innerte xt = Textbox2.Text
Webbrwoser1.Document.GetElementById("default_persi stent").InvokeMember("click")
Webbrowser1.Document.GetElementById(tmp3(1)).Invok emember("click")
End Sub
11/13/2012 12:13 'Heaven.#29
You set tmp1 as String = The sourcecode of Facebook without """
After this you Split Tmp1 , so you get The loginbuttonid
11/14/2012 15:02 24terminetor96#30
What are Chr(34),Dim tmp2() As String = Split(tmp(1), ">") and
Dim tmp3() As String = Split(tmp2(0), "for=")?