[Help]VB.net Webbrowser

Posts 1–12 of 12 · Page 1 of 1
[Help]VB.net Webbrowser
Ok so i am attempting to make an account generator for combat arms. Using the VB.net webbrowser has never been my strong suite . The issue i'm having is that when registering if the user name/email is already taken a little balloon pops up next to the textbox. Nexon Passport Sign-Up The code for the "error" balloon pop up is this:
Code:
<div style="display: inline;" id="balloon_txtPassword_PasswordDoesNotMeetCharacterLimit" class="error_message"><div class="error_tail"></div><img src="http://nxcache.nexon.net/passport/signup/2009_signup/alert.jpg" alt="Alert!">Your password must be between <em>6 - 12 characters.</em></div>
How would i check to see if the balloon pop up showing the error is visible?So basically what im asking is how would i make the program recognize that the error in the registration was the email was already taken vs what i have now where it just says "error"
Try
'code
Catch ex as message
msgbox(ex,MsgboxStyle.Critical, "Error")
End Try
Does the page refresh on a error?
If it does, and you are using a web browser control, then just check the elements

[highlight=xml]
<div style="display: inline;" id="balloon_txtPassword_PasswordDoesNotMeetCharact erLimit" class="error_message"><div class="error_tail"></div><img src="http://nxcache.nexon.net/passport/signup/2009_signup/alert.jpg" alt="Alert!">Your password must be between <em>6 - 12 characters.</em></div>
[/highlight]

Your going to check the html to see if the id
[highlight=xml]
balloon_txtPassword_PasswordDoesNotMeetCharacterLi mit
[/highlight]
exists.

You can do this by checking the innertext of the id listed above or checking to see if the documenttext contains

[highlight=xmll]
our password must be between
[/highlight]


if it doesn't refresh then you can use a timer or have it check when the user clicks a button.

your code could be

[highlight=vbnet]
If WebBrowser1.DocumentText.Contains("Your password must be between") Then
MsgBox("Your Password must be between 6 and 12 char.")
Else
' do nothing
End If
[/highlight]

again, you can use this in a timer to make it happen "Real Time" or you can check it on button event click. choice is yours.

@NextGen1 I tried this it doesn't work :/ because it scans the entire HTML doc for the text so it finds it because the ballon isnt showing but the text is still in the html file, its just the ballon hasn't been called to appear yet, its being hidden but its still there.
You could just create the same restrictions with your text boxes

So, in a test if we call this script

[highlight=java]
javascript:currentlyFocusedObj=this;setTimeout("sh owBalloon(1)", 300);
[/highlight]

then we get the blue box.

if we call this script.

[highlight=java]
javascript:setTimeout("doblur(this,1);clientCheck( 1, 2);", 50);
[/highlight]

we are calling the red bubble part of the code.

When the javascript is triggered it adds some html to the text box id

[highlight=xml]
<input name="txtPassword" type="password" maxlength="50" id="txtPassword" onfocus="javascript:currentlyFocusedObj=this;setTi meout(&quot;showBalloon(1)&quot;, 300);" onblur="javascript:setTimeout(&quot;doblur(this,1) ;clientCheck(1, 2);&quot;, 50);" lang="latn_002" style="border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(204, 0, 0); border-right-color: rgb(204, 0, 0); border-bottom-color: rgb(204, 0, 0); border-left-color: rgb(204, 0, 0); ">
[/highlight]

compared to the original

[highlight=xml]
<input name="txtPassword" type="password" maxlength="50" id="txtPassword" onfocus="javascript:currentlyFocusedObj=this;setTi meout(&quot;showBalloon(1)&quot;, 300);" onblur="javascript:setTimeout(&quot;doblur(this,1) ;clientCheck(1, 2);&quot;, 50);">
[/highlight]

Should be able to check and see if anyone of those new elements exist. If they do.
Then, msgbox.


Quote Originally Posted by NextGen1 View Post
You could just create the same restrictions with your text boxes

So, in a test if we call this script

[highlight=java]
javascript:currentlyFocusedObj=this;setTimeout("sh owBalloon(1)", 300);
[/highlight]

then we get the blue box.

if we call this script.

[highlight=java]
javascript:setTimeout("doblur(this,1);clientCheck( 1, 2);", 50);
[/highlight]

we are calling the red bubble part of the code.

When the javascript is triggered it adds some html to the text box id

[highlight=xml]
<input name="txtPassword" type="password" maxlength="50" id="txtPassword" onfocus="javascript:currentlyFocusedObj=this;setTi meout(&quot;showBalloon(1)&quot;, 300);" onblur="javascript:setTimeout(&quot;doblur(this,1) ;clientCheck(1, 2);&quot;, 50);" lang="latn_002" style="border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(204, 0, 0); border-right-color: rgb(204, 0, 0); border-bottom-color: rgb(204, 0, 0); border-left-color: rgb(204, 0, 0); ">
[/highlight]

compared to the original

[highlight=xml]
<input name="txtPassword" type="password" maxlength="50" id="txtPassword" onfocus="javascript:currentlyFocusedObj=this;setTi meout(&quot;showBalloon(1)&quot;, 300);" onblur="javascript:setTimeout(&quot;doblur(this,1) ;clientCheck(1, 2);&quot;, 50);">
[/highlight]

Should be able to check and see if anyone of those new elements exist. If they do.
Then, msgbox.


i have no idea how to put this into VB.net
It's an aspx page so the page doesn't refresh when the balloon is shown. I remember having this problem a while ago, I don't think I ever solved it back then. Basically, the page contains a bunch of "hidden" balloons with their "hidden" style being 'display: none' However, when one of them is shown, the style of the element is changed to 'display: inline", so really all you need to do is set up a timer or something that checks for 'display: inline' on those balloon elements.
Here you go Bombs - this was a very very old project i was working on a while ago.. it still works, all you need to do is change the ButtonX1 to your needs, cause i used DotNetBar for it...

If you need help just ask..

Code:
Public Class Form2
    Dim msg As Integer = 1
    Dim msg2 As String
    Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    End Sub
    Private Sub ButtonX1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
        Try
            WebBrowser1.Document.GetElementById("txtAccountId").SetAttribute("value", TextBoxX1.Text)
            WebBrowser1.Document.GetElementById("txtPassword").SetAttribute("value", TextBoxX2.Text)
            WebBrowser1.Document.GetElementById("txtEmail").SetAttribute("value", TextBoxX6.Text + "@bobmail.info")
            WebBrowser1.Document.GetElementById("txtEmailConfirmation").SetAttribute("value", TextBoxX6.Text + "@bobmail.info")
            WebBrowser1.Document.GetElementById("txtPasswordConfirmation").SetAttribute("value", TextBoxX2.Text)
            WebBrowser1.Document.GetElementById("txtFirstName").SetAttribute("value", TextBoxX3.Text)
            WebBrowser1.Document.GetElementById("txtLastName").SetAttribute("value", TextBoxX4.Text)
            If ComboBox1.Text = "Janurary" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 1)
            ElseIf ComboBox1.Text = "Feburary" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 2) ' keep doing that ' ok
            ElseIf ComboBox1.Text = "March" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 3)
            ElseIf ComboBox1.Text = "April" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 4) ' lol u will have alot of coding with years...... there alot of years there. enjoy xD. haha with the years is it the same as the months? except i change the GetElementById thing ' exept the value and the element. ok
            ElseIf ComboBox1.Text = "May" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 5)
            ElseIf ComboBox1.Text = "June" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 6)
            ElseIf ComboBox1.Text = "July" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 7)
            ElseIf ComboBox1.Text = "August" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 8)
            ElseIf ComboBox1.Text = "September" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 9)
            ElseIf ComboBox1.Text = "October" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 10)
            ElseIf ComboBox1.Text = "November" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 11)
            ElseIf ComboBox1.Text = "December" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 12)
            End If
            If ComboBox2.Text = "1" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 1)
            ElseIf ComboBox2.Text = "2" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 2)
            ElseIf ComboBox2.Text = "3" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 3)
            ElseIf ComboBox2.Text = "4" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 4)
            ElseIf ComboBox2.Text = "5" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 5)
            ElseIf ComboBox2.Text = "6" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 6)
            ElseIf ComboBox2.Text = "7" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 7)
            ElseIf ComboBox2.Text = "8" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 8)
            ElseIf ComboBox2.Text = "9" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 9)
            ElseIf ComboBox2.Text = "10" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 10)
            ElseIf ComboBox2.Text = "11" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 11)
            ElseIf ComboBox2.Text = "12" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 12)
            ElseIf ComboBox2.Text = "13" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 13)
            ElseIf ComboBox2.Text = "14" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 14)
            ElseIf ComboBox2.Text = "15" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 15)
            ElseIf ComboBox2.Text = "16" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 16)
            ElseIf ComboBox2.Text = "17" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 17)
            ElseIf ComboBox2.Text = "18" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 18)
            ElseIf ComboBox2.Text = "19" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 19)
            ElseIf ComboBox2.Text = "20" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 20)
            ElseIf ComboBox2.Text = "21" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 21)
            ElseIf ComboBox2.Text = "22" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 22)
            ElseIf ComboBox2.Text = "23" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 23)
            ElseIf ComboBox2.Text = "24" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 24)
            ElseIf ComboBox2.Text = "25" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 25)
            ElseIf ComboBox2.Text = "26" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 26)
            ElseIf ComboBox2.Text = "27" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 27)
            ElseIf ComboBox2.Text = "28" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 28)
            ElseIf ComboBox2.Text = "29" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 29)
            ElseIf ComboBox2.Text = "30" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 30)
            ElseIf ComboBox2.Text = "31" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 31)
            End If
            If ComboBox3.Text = "2010" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2010)
            ElseIf ComboBox3.Text = "2009" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2009)
            ElseIf ComboBox3.Text = "2008" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2008)
            ElseIf ComboBox3.Text = "2007" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2007)
            ElseIf ComboBox3.Text = "2006" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2006)
            ElseIf ComboBox3.Text = "2005" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2005)
            ElseIf ComboBox3.Text = "2004" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2004)
            ElseIf ComboBox3.Text = "2003" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2003)
            ElseIf ComboBox3.Text = "2002" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2002)
            ElseIf ComboBox3.Text = "2001" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2001)
            ElseIf ComboBox3.Text = "2000" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2000)
            ElseIf ComboBox3.Text = "1999" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1999)
            ElseIf ComboBox3.Text = "1998" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1998)
            ElseIf ComboBox3.Text = "1997" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1997)
            ElseIf ComboBox3.Text = "1996" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1996)
            ElseIf ComboBox3.Text = "1995" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1995)
            ElseIf ComboBox3.Text = "1994" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1984)
            ElseIf ComboBox3.Text = "1993" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1993)
            ElseIf ComboBox3.Text = "1992" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1992)
            ElseIf ComboBox3.Text = "1991" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1991)
            ElseIf ComboBox3.Text = "1990" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1900)
            ElseIf ComboBox3.Text = "1989" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1989)
            ElseIf ComboBox3.Text = "1988" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1988)
            ElseIf ComboBox3.Text = "1987" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1987)
            ElseIf ComboBox3.Text = "1986" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1986)
            ElseIf ComboBox3.Text = "1985" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1985)
            ElseIf ComboBox3.Text = "1984" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1984)
            ElseIf ComboBox3.Text = "1983" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1983)
            ElseIf ComboBox3.Text = "1982" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1982)
            ElseIf ComboBox3.Text = "1981" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1981)
            ElseIf ComboBox3.Text = "1980" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1980)
            ElseIf ComboBox3.Text = "1979" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1979)
            ElseIf ComboBox3.Text = "1978" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1978)
            ElseIf ComboBox3.Text = "1977" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1977)
            ElseIf ComboBox3.Text = "1976" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1976)
            ElseIf ComboBox3.Text = "1975" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1975)
            ElseIf ComboBox3.Text = "1974" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1974)
            ElseIf ComboBox3.Text = "1973" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1973)
            ElseIf ComboBox3.Text = "1972" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1972)
            ElseIf ComboBox3.Text = "1971" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1971)
            ElseIf ComboBox3.Text = "1970" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1970)
            End If
            If RadioButton1.Checked Then
                WebBrowser1.Document.GetElementById("rbGenderMale").InvokeMember("click")
            ElseIf RadioButton2.Checked Then
                WebBrowser1.Document.GetElementById("rbGenderFemale").InvokeMember("click") ' give me a sec kk
            End If
            WebBrowser1.Document.GetElementById("chkTermofuse").SetAttribute("checked", 1)
            WebBrowser1.Document.GetElementById("btnSubmit").InvokeMember("click") 'txtCaptcha
            WebBrowser1.Document.GetElementById("txtCaptcha").SetAttribute("value", TextBox1.Text)
        Catch ax As Exception
        End Try
    End Sub
    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        RichTextBox1.Text = WebBrowser1.DocumentText
        If RichTextBox1.Text.Contains("Activate your account and you’re ready to play!") Then
            Do Until msg = 2
                msg = MsgBox("Thanks For Registering! You Will Now Be Taken To The Email Which Is Where You Can Complete The Sign-Up", MsgBoxStyle.Information, "Registered")
                Process.Start("http://mailinator.com/maildir.jsp?email=" + TextBoxX6.Text) 'this will open the website with the email mailinator + the email they written ' to save some bugs ( the msgbox will be unlimited value ) we neeb to put it as 1 time shown
                msg = msg + 1
            Loop
        End If
        Try
            Dim captcha1 As HtmlElement
            captcha1 = WebBrowser1.Document.GetElementById("captchaFS_Image")
            Dim path As String = captcha1.GetAttribute("src")
            TextBox7.Text = path
            Dim TextFile As New StreamWriter("captcha.html")
            TextFile.WriteLine("<img src=" & TextBox1.Text & "id" & "=" & "captchaFS_Image" & " >")
            TextFile.Close()
            WebBrowser2.Navigate("/captcha.html")
            Dim captcha2 As HtmlElement
            captcha2 = WebBrowser1.Document.GetElementById("captchaFS_Image")
            Dim path2 As String = captcha2.GetAttribute("src")
            PictureBox1.ImageLocation = path2
        Catch ax As Exception
        End Try
    End Sub
    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ComboBoxEx1.SelectedIndex = 0
    End Sub
    Private Sub CheckBoxX1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBoxX1.CheckedChanged
        If CheckBoxX1.Checked = True Then
            TextBoxX2.UseSystemPasswordChar = False
            CheckBoxX1.Checked = False
        End If
    End Sub
    Private Sub CheckBoxX2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBoxX2.CheckedChanged
        If CheckBoxX2.Checked = True Then
            TextBoxX2.UseSystemPasswordChar = True
            CheckBoxX2.Checked = False
        End If
    End Sub
    Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
        Me.Height = "945"
    End Sub
    Private Sub ButtonX8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX8.Click
        Me.Height = "571"
    End Sub

    Private Sub CheckBoxX3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBoxX3.CheckedChanged
        If CheckBoxX3.Checked = True Then
            Me.Width = "1060"
        ElseIf CheckBoxX3.Checked = False Then
            Me.Width = "347"
            Me.Height = "571"
        End If
    End Sub
End Class
This isnt exactly how you wanted it!
Quote Originally Posted by AceKill3r View Post
Here you go Bombs - this was a very very old project i was working on a while ago.. it still works, all you need to do is change the ButtonX1 to your needs, cause i used DotNetBar for it...

If you need help just ask..

Code:
Public Class Form2
    Dim msg As Integer = 1
    Dim msg2 As String
    Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    End Sub
    Private Sub ButtonX1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
        Try
            WebBrowser1.Document.GetElementById("txtAccountId").SetAttribute("value", TextBoxX1.Text)
            WebBrowser1.Document.GetElementById("txtPassword").SetAttribute("value", TextBoxX2.Text)
            WebBrowser1.Document.GetElementById("txtEmail").SetAttribute("value", TextBoxX6.Text + "@bobmail.info")
            WebBrowser1.Document.GetElementById("txtEmailConfirmation").SetAttribute("value", TextBoxX6.Text + "@bobmail.info")
            WebBrowser1.Document.GetElementById("txtPasswordConfirmation").SetAttribute("value", TextBoxX2.Text)
            WebBrowser1.Document.GetElementById("txtFirstName").SetAttribute("value", TextBoxX3.Text)
            WebBrowser1.Document.GetElementById("txtLastName").SetAttribute("value", TextBoxX4.Text)
            If ComboBox1.Text = "Janurary" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 1)
            ElseIf ComboBox1.Text = "Feburary" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 2) ' keep doing that ' ok
            ElseIf ComboBox1.Text = "March" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 3)
            ElseIf ComboBox1.Text = "April" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 4) ' lol u will have alot of coding with years...... there alot of years there. enjoy xD. haha with the years is it the same as the months? except i change the GetElementById thing ' exept the value and the element. ok
            ElseIf ComboBox1.Text = "May" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 5)
            ElseIf ComboBox1.Text = "June" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 6)
            ElseIf ComboBox1.Text = "July" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 7)
            ElseIf ComboBox1.Text = "August" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 8)
            ElseIf ComboBox1.Text = "September" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 9)
            ElseIf ComboBox1.Text = "October" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 10)
            ElseIf ComboBox1.Text = "November" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 11)
            ElseIf ComboBox1.Text = "December" Then
                WebBrowser1.Document.GetElementById("ddlBirthMonth").SetAttribute("value", 12)
            End If
            If ComboBox2.Text = "1" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 1)
            ElseIf ComboBox2.Text = "2" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 2)
            ElseIf ComboBox2.Text = "3" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 3)
            ElseIf ComboBox2.Text = "4" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 4)
            ElseIf ComboBox2.Text = "5" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 5)
            ElseIf ComboBox2.Text = "6" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 6)
            ElseIf ComboBox2.Text = "7" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 7)
            ElseIf ComboBox2.Text = "8" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 8)
            ElseIf ComboBox2.Text = "9" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 9)
            ElseIf ComboBox2.Text = "10" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 10)
            ElseIf ComboBox2.Text = "11" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 11)
            ElseIf ComboBox2.Text = "12" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 12)
            ElseIf ComboBox2.Text = "13" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 13)
            ElseIf ComboBox2.Text = "14" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 14)
            ElseIf ComboBox2.Text = "15" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 15)
            ElseIf ComboBox2.Text = "16" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 16)
            ElseIf ComboBox2.Text = "17" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 17)
            ElseIf ComboBox2.Text = "18" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 18)
            ElseIf ComboBox2.Text = "19" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 19)
            ElseIf ComboBox2.Text = "20" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 20)
            ElseIf ComboBox2.Text = "21" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 21)
            ElseIf ComboBox2.Text = "22" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 22)
            ElseIf ComboBox2.Text = "23" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 23)
            ElseIf ComboBox2.Text = "24" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 24)
            ElseIf ComboBox2.Text = "25" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 25)
            ElseIf ComboBox2.Text = "26" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 26)
            ElseIf ComboBox2.Text = "27" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 27)
            ElseIf ComboBox2.Text = "28" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 28)
            ElseIf ComboBox2.Text = "29" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 29)
            ElseIf ComboBox2.Text = "30" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 30)
            ElseIf ComboBox2.Text = "31" Then
                WebBrowser1.Document.GetElementById("ddlBirthDay").SetAttribute("value", 31)
            End If
            If ComboBox3.Text = "2010" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2010)
            ElseIf ComboBox3.Text = "2009" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2009)
            ElseIf ComboBox3.Text = "2008" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2008)
            ElseIf ComboBox3.Text = "2007" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2007)
            ElseIf ComboBox3.Text = "2006" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2006)
            ElseIf ComboBox3.Text = "2005" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2005)
            ElseIf ComboBox3.Text = "2004" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2004)
            ElseIf ComboBox3.Text = "2003" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2003)
            ElseIf ComboBox3.Text = "2002" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2002)
            ElseIf ComboBox3.Text = "2001" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2001)
            ElseIf ComboBox3.Text = "2000" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 2000)
            ElseIf ComboBox3.Text = "1999" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1999)
            ElseIf ComboBox3.Text = "1998" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1998)
            ElseIf ComboBox3.Text = "1997" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1997)
            ElseIf ComboBox3.Text = "1996" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1996)
            ElseIf ComboBox3.Text = "1995" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1995)
            ElseIf ComboBox3.Text = "1994" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1984)
            ElseIf ComboBox3.Text = "1993" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1993)
            ElseIf ComboBox3.Text = "1992" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1992)
            ElseIf ComboBox3.Text = "1991" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1991)
            ElseIf ComboBox3.Text = "1990" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1900)
            ElseIf ComboBox3.Text = "1989" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1989)
            ElseIf ComboBox3.Text = "1988" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1988)
            ElseIf ComboBox3.Text = "1987" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1987)
            ElseIf ComboBox3.Text = "1986" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1986)
            ElseIf ComboBox3.Text = "1985" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1985)
            ElseIf ComboBox3.Text = "1984" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1984)
            ElseIf ComboBox3.Text = "1983" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1983)
            ElseIf ComboBox3.Text = "1982" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1982)
            ElseIf ComboBox3.Text = "1981" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1981)
            ElseIf ComboBox3.Text = "1980" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1980)
            ElseIf ComboBox3.Text = "1979" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1979)
            ElseIf ComboBox3.Text = "1978" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1978)
            ElseIf ComboBox3.Text = "1977" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1977)
            ElseIf ComboBox3.Text = "1976" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1976)
            ElseIf ComboBox3.Text = "1975" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1975)
            ElseIf ComboBox3.Text = "1974" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1974)
            ElseIf ComboBox3.Text = "1973" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1973)
            ElseIf ComboBox3.Text = "1972" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1972)
            ElseIf ComboBox3.Text = "1971" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1971)
            ElseIf ComboBox3.Text = "1970" Then
                WebBrowser1.Document.GetElementById("ddlBirthYear").SetAttribute("value", 1970)
            End If
            If RadioButton1.Checked Then
                WebBrowser1.Document.GetElementById("rbGenderMale").InvokeMember("click")
            ElseIf RadioButton2.Checked Then
                WebBrowser1.Document.GetElementById("rbGenderFemale").InvokeMember("click") ' give me a sec kk
            End If
            WebBrowser1.Document.GetElementById("chkTermofuse").SetAttribute("checked", 1)
            WebBrowser1.Document.GetElementById("btnSubmit").InvokeMember("click") 'txtCaptcha
            WebBrowser1.Document.GetElementById("txtCaptcha").SetAttribute("value", TextBox1.Text)
        Catch ax As Exception
        End Try
    End Sub
    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        RichTextBox1.Text = WebBrowser1.DocumentText
        If RichTextBox1.Text.Contains("Activate your account and you’re ready to play!") Then
            Do Until msg = 2
                msg = MsgBox("Thanks For Registering! You Will Now Be Taken To The Email Which Is Where You Can Complete The Sign-Up", MsgBoxStyle.Information, "Registered")
                Process.Start("http://mailinator.com/maildir.jsp?email=" + TextBoxX6.Text) 'this will open the website with the email mailinator + the email they written ' to save some bugs ( the msgbox will be unlimited value ) we neeb to put it as 1 time shown
                msg = msg + 1
            Loop
        End If
        Try
            Dim captcha1 As HtmlElement
            captcha1 = WebBrowser1.Document.GetElementById("captchaFS_Image")
            Dim path As String = captcha1.GetAttribute("src")
            TextBox7.Text = path
            Dim TextFile As New StreamWriter("captcha.html")
            TextFile.WriteLine("<img src=" & TextBox1.Text & "id" & "=" & "captchaFS_Image" & " >")
            TextFile.Close()
            WebBrowser2.Navigate("/captcha.html")
            Dim captcha2 As HtmlElement
            captcha2 = WebBrowser1.Document.GetElementById("captchaFS_Image")
            Dim path2 As String = captcha2.GetAttribute("src")
            PictureBox1.ImageLocation = path2
        Catch ax As Exception
        End Try
    End Sub
    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ComboBoxEx1.SelectedIndex = 0
    End Sub
    Private Sub CheckBoxX1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBoxX1.CheckedChanged
        If CheckBoxX1.Checked = True Then
            TextBoxX2.UseSystemPasswordChar = False
            CheckBoxX1.Checked = False
        End If
    End Sub
    Private Sub CheckBoxX2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBoxX2.CheckedChanged
        If CheckBoxX2.Checked = True Then
            TextBoxX2.UseSystemPasswordChar = True
            CheckBoxX2.Checked = False
        End If
    End Sub
    Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
        Me.Height = "945"
    End Sub
    Private Sub ButtonX8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX8.Click
        Me.Height = "571"
    End Sub

    Private Sub CheckBoxX3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBoxX3.CheckedChanged
        If CheckBoxX3.Checked = True Then
            Me.Width = "1060"
        ElseIf CheckBoxX3.Checked = False Then
            Me.Width = "347"
            Me.Height = "571"
        End If
    End Sub
End Class
This isnt exactly how you wanted it!
The problem wasn't the coding, it was how to check whether a little error balloon has popped up (i.e the chosen username is already in use)
if what. jason said is true (about display: none)." then just execute some JS to check the current display style of those controls...
Quote Originally Posted by freedompeace View Post
if what. jason said is true (about display: none)." then just execute some JS to check the current display style of those controls...
[highlight=vb.net]For Each divElem As HTMLElement In WebBrowser1.Document.GetElementsByTag("div")
If divElem.GetAttribute("id") = "balloon_txtPassword_PasswordDoesNotMeetCharacterL imit"
If divElem.GetAttribute("style") = "display: inline;"
'Popup is being shown!
Else
'Popup is not being shown!
End If
End If
Next[/highlight]
Of course, that wouldn't work because the page's source is not real-time (at least I don't think it is...) so you have to execute some JS somehow like freedompeace said. I have no idea how to.
For the password make the textbox max length 12 and put this code in genrate button
Code:
If PasswordTxt.Text.Length < 6
Msgbox("Your password must be at least 6 charaters")
Exit Sub
End If
why do u even check it , if u can make it
for the email/username i don't know but i remmeber when i enter already used one the webbrowser msgbox me telling me that
Posts 1–12 of 12 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?