Delay Code? Make Account Bot Look Human

Posts 16–30 of 30 · Page 2 of 2
It would but could cause problems.
I'll see if i can put a sample app together for ya and give ya the source.

I'v don't messed with webbrowser so it should be interesting.
Code:
Private Delcare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

WebBrowser1.Document.GetElementById("iFirstName").Focus()
WebBrowser1.Document.GetElementById("iFirstName").SetAttribute("value", TextBox1.Text)
Sleep(500)
WebBrowser1.Document.GetElementById("iLastName").Focus()
WebBrowser1.Document.GetElementById("iLastName").SetAttribute("value", TextBox2.Text)
Sleep(500)
WebBrowser1.Document.GetElementById("iBirthDay").Focus()
WebBrowser1.Document.GetElementById("iBirthDay").SetAttribute("value", ComboBox2.Text)
Sleep(500)
WebBrowser1.Document.GetElementById("iBirthMonth").Focus()
WebBrowser1.Document.GetElementById("iBirthMonth").SetAttribute("value", ComboBox1.Text)
Sleep(500)
WebBrowser1.Document.GetElementById("iBirthYear").Focus()
WebBrowser1.Document.GetElementById("iBirthYear").SetAttribute("value", ComboBox3.Text)
Quote Originally Posted by Biesi View Post
Code:
Private Delcare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

WebBrowser1.Document.GetElementById("iFirstName").Focus()
WebBrowser1.Document.GetElementById("iFirstName").SetAttribute("value", TextBox1.Text)
Sleep(500)
WebBrowser1.Document.GetElementById("iLastName").Focus()
WebBrowser1.Document.GetElementById("iLastName").SetAttribute("value", TextBox2.Text)
Sleep(500)
WebBrowser1.Document.GetElementById("iBirthDay").Focus()
WebBrowser1.Document.GetElementById("iBirthDay").SetAttribute("value", ComboBox2.Text)
Sleep(500)
WebBrowser1.Document.GetElementById("iBirthMonth").Focus()
WebBrowser1.Document.GetElementById("iBirthMonth").SetAttribute("value", ComboBox1.Text)
Sleep(500)
WebBrowser1.Document.GetElementById("iBirthYear").Focus()
WebBrowser1.Document.GetElementById("iBirthYear").SetAttribute("value", ComboBox3.Text)
I know this is simple stuff to you guys but bare with me lol



Quote Originally Posted by Pingo View Post
It would but could cause problems.
I'll see if i can put a sample app together for ya and give ya the source.

I'v don't messed with webbrowser so it should be interesting.
Would appreciate it, can't see what im doing wrong.
Using the API without calling Application.DoEvents like that is 100% the same as using Threading.Thread.Sleep and is not what you want OP.

edit:
 
Code

Mostly copy-pasted from your code + using the API and (modified) Sub mentioned by pootuba

Code:
Public Class Form1

    '' API Declaration(s)
    Private Declare Function GetTickCount Lib "kernel32" () As Long

    Private Sub Wait(ByVal milliSeconds As Int32)
        Dim endTickTime As Long
        ''https://www.google.com/search?q=number+of+ticks+in+a+second
        '' 10,000,000 (ten million) ticks = 1 second.
        '' 10k ticks = 1 millisecond
        endTickTime = GetTickCount() + (milliSeconds * 10000)

        Do While endTickTime >= GetTickCount()
            Application.DoEvents() '' Refresh GUI
        Loop
    End Sub



    Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        If WebBrowser1.DocumentTitle = "Sign in to your Microsoft account" And WebBrowser1.Url.ToString.StartsWith("https://login.live.com/") Then
            ''on initial page, need to click sign-up button
            ClickTheSignUpButton() ' Recursion.
        ElseIf WebBrowser1.DocumentTitle = "Sign up - Microsoft account" Then
            ''hmm..
            FillBoxesWithValues()
        ElseIf WebBrowser1.DocumentTitle.ToString.StartsWith("Outlook - " + TextBox3.Text) Then
            MsgBox("Your account has been successfully created and the details saved in the history tab")
        End If
    End Sub

    Private Sub ClickTheSignUpButton()
        WebBrowser1.Document.GetElementById("idA_SignUp").Focus()
        WebBrowser1.Document.GetElementById("idA_SignUp").InvokeMember("click")
    End Sub
    Private Sub FillBoxesWithValues()
        ''TODO: Chane Wait(1000) to use Random.Next '' - see previous post for demo
        WebBrowser1.Document.GetElementById("iFirstName").Focus()
        WebBrowser1.Document.GetElementById("iFirstName").SetAttribute("value", TextBox1.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iLastName").Focus()
        WebBrowser1.Document.GetElementById("iLastName").SetAttribute("value", TextBox2.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthDay").Focus()
        WebBrowser1.Document.GetElementById("iBirthDay").SetAttribute("value", ComboBox2.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthMonth").Focus()
        WebBrowser1.Document.GetElementById("iBirthMonth").SetAttribute("value", ComboBox1.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthYear").Focus()
        WebBrowser1.Document.GetElementById("iBirthYear").SetAttribute("value", ComboBox3.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("imembernameeasi").Focus()
        WebBrowser1.Document.GetElementById("imembernameeasi").SetAttribute("value", TextBox3.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iPwd").Focus()
        WebBrowser1.Document.GetElementById("iPwd").SetAttribute("value", TextBox4.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iRetypePwd").Focus()
        WebBrowser1.Document.GetElementById("iRetypePwd").SetAttribute("value", TextBox4.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iPhone").Focus()
        WebBrowser1.Document.GetElementById("iPhone").SetAttribute("value", TextBox5.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iAltEmail").Focus()
        WebBrowser1.Document.GetElementById("iAltEmail").SetAttribute("value", TextBox6.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iZipCode").Focus()
        WebBrowser1.Document.GetElementById("iZipCode").SetAttribute("value", TextBox7.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthYear").Focus()
        SendKeys.Send("{TAB}")
        SendKeys.Send("{DOWN}")
        MsgBox("Filling in the form has comepleted, please scroll to the bottom of the page and comeplete the captcha")
        WebBrowser1.Document.GetElementById("iBirthYear").Focus()
        SendKeys.Send("{TAB}")
        SendKeys.Send("{DOWN}")
    End Sub
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        Try
            WebBrowser1.Navigate("https://login.live.com")
            TabControl1.SelectTab(1)
        Catch ex As Exception
            MsgBox("something went wrong the form was unable to be comepleted")
        End Try

    End Sub

End Class

'' TODO: spelling: "complete" in the MsgBox()s  : p


 
idk, but maybe

Quote Originally Posted by silentrunner2 View Post
I know this is simple stuff to you guys but bare with me lol





Would appreciate it, can't see what im doing wrong.
I think the API declaration is wrong..but I could be wrong because I hate how M$ does their C++ declarations.
Code:
// Quoted from M$ : http://msdn.microsoft.com/en-us/library/windows/desktop/ms686298%28v=vs.85%29.aspx

VOID WINAPI Sleep(
  _In_  DWORD dwMilliseconds
);
http://stackoverflow.com/questions/6...-architectures
I think DWORD = old microsoft name for size=32 bits (or 4 bytes)
So the API should be declared

Private Declare Sub Sleep Lib "kernel32" (Byval dwMilliseconds As Int32)

I think if you were programming in vb6 a long = 32 bits, but for .net it's 64.

Quote Originally Posted by abuckau907 View Post
Using the API without calling Application.DoEvents like that is 100% the same as using Threading.Thread.Sleep and is not what you want OP.

edit:
 
Code

Mostly copy-pasted from your code + using the API and (modified) Sub mentioned by pootuba

Code:
Public Class Form1

    '' API Declaration(s)
    Private Declare Function GetTickCount Lib "kernel32" () As Long

    Private Sub Wait(ByVal milliSeconds As Int32)
        Dim endTickTime As Long
        ''https://www.google.com/search?q=number+of+ticks+in+a+second
        '' 10,000,000 (ten million) ticks = 1 second.
        '' 10k ticks = 1 millisecond
        endTickTime = GetTickCount() + (milliSeconds * 10000)

        Do While endTickTime >= GetTickCount()
            Application.DoEvents() '' Refresh GUI
        Loop
    End Sub



    Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        If WebBrowser1.DocumentTitle = "Sign in to your Microsoft account" And WebBrowser1.Url.ToString.StartsWith("https://login.live.com/") Then
            ''on initial page, need to click sign-up button
            ClickTheSignUpButton() ' Recursion.
        ElseIf WebBrowser1.DocumentTitle = "Sign up - Microsoft account" Then
            ''hmm..
            FillBoxesWithValues()
        ElseIf WebBrowser1.DocumentTitle.ToString.StartsWith("Outlook - " + TextBox3.Text) Then
            MsgBox("Your account has been successfully created and the details saved in the history tab")
        End If
    End Sub

    Private Sub ClickTheSignUpButton()
        WebBrowser1.Document.GetElementById("idA_SignUp").Focus()
        WebBrowser1.Document.GetElementById("idA_SignUp").InvokeMember("click")
    End Sub
    Private Sub FillBoxesWithValues()
        ''TODO: Chane Wait(1000) to use Random.Next '' - see previous post for demo
        WebBrowser1.Document.GetElementById("iFirstName").Focus()
        WebBrowser1.Document.GetElementById("iFirstName").SetAttribute("value", TextBox1.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iLastName").Focus()
        WebBrowser1.Document.GetElementById("iLastName").SetAttribute("value", TextBox2.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthDay").Focus()
        WebBrowser1.Document.GetElementById("iBirthDay").SetAttribute("value", ComboBox2.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthMonth").Focus()
        WebBrowser1.Document.GetElementById("iBirthMonth").SetAttribute("value", ComboBox1.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthYear").Focus()
        WebBrowser1.Document.GetElementById("iBirthYear").SetAttribute("value", ComboBox3.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("imembernameeasi").Focus()
        WebBrowser1.Document.GetElementById("imembernameeasi").SetAttribute("value", TextBox3.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iPwd").Focus()
        WebBrowser1.Document.GetElementById("iPwd").SetAttribute("value", TextBox4.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iRetypePwd").Focus()
        WebBrowser1.Document.GetElementById("iRetypePwd").SetAttribute("value", TextBox4.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iPhone").Focus()
        WebBrowser1.Document.GetElementById("iPhone").SetAttribute("value", TextBox5.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iAltEmail").Focus()
        WebBrowser1.Document.GetElementById("iAltEmail").SetAttribute("value", TextBox6.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iZipCode").Focus()
        WebBrowser1.Document.GetElementById("iZipCode").SetAttribute("value", TextBox7.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthYear").Focus()
        SendKeys.Send("{TAB}")
        SendKeys.Send("{DOWN}")
        MsgBox("Filling in the form has comepleted, please scroll to the bottom of the page and comeplete the captcha")
        WebBrowser1.Document.GetElementById("iBirthYear").Focus()
        SendKeys.Send("{TAB}")
        SendKeys.Send("{DOWN}")
    End Sub
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        Try
            WebBrowser1.Navigate("https://login.live.com")
            TabControl1.SelectTab(1)
        Catch ex As Exception
            MsgBox("something went wrong the form was unable to be comepleted")
        End Try

    End Sub

End Class

'' TODO: spelling: "complete" in the MsgBox()s  : p


 
idk, but maybe



I think the API declaration is wrong..but I could be wrong because I hate how M$ does their C++ declarations.
Code:
// Quoted from M$ : http://msdn.microsoft.com/en-us/library/windows/desktop/ms686298%28v=vs.85%29.aspx

VOID WINAPI Sleep(
  _In_  DWORD dwMilliseconds
);
data structures - How many bits is a WORD and is that constant over different architectures? - Stack Overflow
I think DWORD = old microsoft name for size=32 bits (or 4 bytes)
So the API should be declared

Private Declare Sub Sleep Lib "kernel32" (Byval dwMilliseconds As Int32)

I think if you were programming in vb6 a long = 32 bits, but for .net it's 64.

Thanks again buddy but still doesn't like this, I also tryed getting rid of the timers but still no luck. Program just seems to freeze as usual, I have looked all over google for a decent solution to this but still yet to find one. Btw just incase you think im being a total nub I have tested it without any of this sleep stuff and it fills in the forms fine.

I think it just messes with the webbrowser in someway Im sure I read somewhere when I was reading last night that it won't work with a browser. People normally shout at me anyways and say use webrequests but i hate that method and honestly i find it all confusing lol.
Hmm. I was pretty sure the code I posted would work. Anyway, best of luck.

edit: If you describe "...but still doesn't like this..." a little better, I'll try to comment. Syntax error or gui freezes or ?
Quote Originally Posted by abuckau907 View Post
Hmm. I was pretty sure the code I posted would work. Anyway, best of luck.

edit: If you describe "...but still doesn't like this..." a little better, I'll try to comment. Syntax error or gui freezes or ?
Woops sorry, yeah the whole program freezes even if i close the program it still shows as debugging.
Very odd, tbh I'm not sure. Do you have ANY code that deals with closing the form (other than the standard close button)?

Code:
Public Class Form1

    '' API Declaration(s)
    Private Declare Function GetTickCount Lib "kernel32" () As Long

    Private Sub Wait(ByVal milliSeconds As Int32)
        Dim endTickTime As Long
        ''https://www.google.com/search?q=number+of+ticks+in+a+second
        '' 10,000,000 (ten million) ticks = 1 second.
        '' 10k ticks = 1 millisecond
        endTickTime = GetTickCount() + (milliSeconds * 10000)

        Do While endTickTime >= GetTickCount()
            Application.DoEvents() '' Refresh GUI
        Loop
    End Sub



    Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        If WebBrowser1.DocumentTitle = "Sign in to your Microsoft account" And WebBrowser1.Url.ToString.StartsWith("https://login.live.com/") Then
            ''on initial page, need to click sign-up button
            ClickTheSignUpButton() ' Recursion.
        ElseIf WebBrowser1.DocumentTitle = "Sign up - Microsoft account" Then
            ''hmm..
            FillBoxesWithValues()
        ElseIf WebBrowser1.DocumentTitle.ToString.StartsWith("Outlook - " + TextBox3.Text) Then
            MsgBox("Your account has been successfully created and the details saved in the history tab")
        End If
    End Sub

    Private Sub ClickTheSignUpButton()
        WebBrowser1.Document.GetElementById("idA_SignUp").Focus()
        WebBrowser1.Document.GetElementById("idA_SignUp").InvokeMember("click")
    End Sub
    Private Sub FillBoxesWithValues()
        ''TODO: Chane Wait(1000) to use Random.Next '' - see previous post for demo
        WebBrowser1.Document.GetElementById("iFirstName").Focus()
        WebBrowser1.Document.GetElementById("iFirstName").SetAttribute("value", TextBox1.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iLastName").Focus()
        WebBrowser1.Document.GetElementById("iLastName").SetAttribute("value", TextBox2.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthDay").Focus()
        WebBrowser1.Document.GetElementById("iBirthDay").SetAttribute("value", ComboBox2.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthMonth").Focus()
        WebBrowser1.Document.GetElementById("iBirthMonth").SetAttribute("value", ComboBox1.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthYear").Focus()
        WebBrowser1.Document.GetElementById("iBirthYear").SetAttribute("value", ComboBox3.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("imembernameeasi").Focus()
        WebBrowser1.Document.GetElementById("imembernameeasi").SetAttribute("value", TextBox3.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iPwd").Focus()
        WebBrowser1.Document.GetElementById("iPwd").SetAttribute("value", TextBox4.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iRetypePwd").Focus()
        WebBrowser1.Document.GetElementById("iRetypePwd").SetAttribute("value", TextBox4.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iPhone").Focus()
        WebBrowser1.Document.GetElementById("iPhone").SetAttribute("value", TextBox5.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iAltEmail").Focus()
        WebBrowser1.Document.GetElementById("iAltEmail").SetAttribute("value", TextBox6.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iZipCode").Focus()
        WebBrowser1.Document.GetElementById("iZipCode").SetAttribute("value", TextBox7.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthYear").Focus()
        SendKeys.Send("{TAB}")
        SendKeys.Send("{DOWN}")
        MsgBox("Filling in the form has comepleted, please scroll to the bottom of the page and comeplete the captcha")
        WebBrowser1.Document.GetElementById("iBirthYear").Focus()
        SendKeys.Send("{TAB}")
        SendKeys.Send("{DOWN}")
    End Sub
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        Try
            WebBrowser1.Navigate("https://login.live.com")
            TabControl1.SelectTab(1)
        Catch ex As Exception
            MsgBox("something went wrong the form was unable to be comepleted")
        End Try

    End Sub

End Class

'' TODO: spelling: "complete" in the MsgBox()s  : p
'' TODO: I pasted from your code, and just noticed, .ToString is redundant, but not a 'problem'
'' ElseIf WebBrowser1.DocumentTitle.ToString.StartsWith("Outlook - " + TextBox3.Text) Then
Maybe create a backup copy of the project for safe-keeping, then erase everything between between Public Class Form1, and End Class, and replace w/ the code I posted. Does it compile, and/or any specific errors?
Quote Originally Posted by abuckau907 View Post
Very odd, tbh I'm not sure. Do you have ANY code that deals with closing the form (other than the standard close button)?

Code:
Public Class Form1

    '' API Declaration(s)
    Private Declare Function GetTickCount Lib "kernel32" () As Long

    Private Sub Wait(ByVal milliSeconds As Int32)
        Dim endTickTime As Long
        ''https://www.google.com/search?q=number+of+ticks+in+a+second
        '' 10,000,000 (ten million) ticks = 1 second.
        '' 10k ticks = 1 millisecond
        endTickTime = GetTickCount() + (milliSeconds * 10000)

        Do While endTickTime >= GetTickCount()
            Application.DoEvents() '' Refresh GUI
        Loop
    End Sub



    Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        If WebBrowser1.DocumentTitle = "Sign in to your Microsoft account" And WebBrowser1.Url.ToString.StartsWith("https://login.live.com/") Then
            ''on initial page, need to click sign-up button
            ClickTheSignUpButton() ' Recursion.
        ElseIf WebBrowser1.DocumentTitle = "Sign up - Microsoft account" Then
            ''hmm..
            FillBoxesWithValues()
        ElseIf WebBrowser1.DocumentTitle.ToString.StartsWith("Outlook - " + TextBox3.Text) Then
            MsgBox("Your account has been successfully created and the details saved in the history tab")
        End If
    End Sub

    Private Sub ClickTheSignUpButton()
        WebBrowser1.Document.GetElementById("idA_SignUp").Focus()
        WebBrowser1.Document.GetElementById("idA_SignUp").InvokeMember("click")
    End Sub
    Private Sub FillBoxesWithValues()
        ''TODO: Chane Wait(1000) to use Random.Next '' - see previous post for demo
        WebBrowser1.Document.GetElementById("iFirstName").Focus()
        WebBrowser1.Document.GetElementById("iFirstName").SetAttribute("value", TextBox1.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iLastName").Focus()
        WebBrowser1.Document.GetElementById("iLastName").SetAttribute("value", TextBox2.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthDay").Focus()
        WebBrowser1.Document.GetElementById("iBirthDay").SetAttribute("value", ComboBox2.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthMonth").Focus()
        WebBrowser1.Document.GetElementById("iBirthMonth").SetAttribute("value", ComboBox1.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthYear").Focus()
        WebBrowser1.Document.GetElementById("iBirthYear").SetAttribute("value", ComboBox3.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("imembernameeasi").Focus()
        WebBrowser1.Document.GetElementById("imembernameeasi").SetAttribute("value", TextBox3.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iPwd").Focus()
        WebBrowser1.Document.GetElementById("iPwd").SetAttribute("value", TextBox4.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iRetypePwd").Focus()
        WebBrowser1.Document.GetElementById("iRetypePwd").SetAttribute("value", TextBox4.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iPhone").Focus()
        WebBrowser1.Document.GetElementById("iPhone").SetAttribute("value", TextBox5.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iAltEmail").Focus()
        WebBrowser1.Document.GetElementById("iAltEmail").SetAttribute("value", TextBox6.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iZipCode").Focus()
        WebBrowser1.Document.GetElementById("iZipCode").SetAttribute("value", TextBox7.Text)
        Wait(1000)
        WebBrowser1.Document.GetElementById("iBirthYear").Focus()
        SendKeys.Send("{TAB}")
        SendKeys.Send("{DOWN}")
        MsgBox("Filling in the form has comepleted, please scroll to the bottom of the page and comeplete the captcha")
        WebBrowser1.Document.GetElementById("iBirthYear").Focus()
        SendKeys.Send("{TAB}")
        SendKeys.Send("{DOWN}")
    End Sub
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        Try
            WebBrowser1.Navigate("https://login.live.com")
            TabControl1.SelectTab(1)
        Catch ex As Exception
            MsgBox("something went wrong the form was unable to be comepleted")
        End Try

    End Sub

End Class

'' TODO: spelling: "complete" in the MsgBox()s  : p
'' TODO: I pasted from your code, and just noticed, .ToString is redundant, but not a 'problem'
'' ElseIf WebBrowser1.DocumentTitle.ToString.StartsWith("Outlook - " + TextBox3.Text) Then
Maybe create a backup copy of the project for safe-keeping, then erase everything between between Public Class Form1, and End Class, and replace w/ the code I posted. Does it compile, and/or any specific errors?
Nope no errors before or after debugging just seems to freeze, hmmmmm is there maybe a kind botched method i could use i saw one guy recommend timers but i would need to many it would be a pain.
I'm not 100% on this, but if you set Timer.Enabled = false at the end of the timer_sub , it basically defeats the point of using a timer (ie. it will only execute 1 time...timers are meant to "repeat"), and is equivalent to just making a Sub.

Hmm..I'm not familiar with the webbrowser class, I could speculate, but that's all it would be.

I think maybe the problem is because web1.Navigate( ) won't let the gui update until the page is fully loaded. (ie. 1-3 seconds ?)

Now I'm just reaching..maybe this 1 line will make a noticeable difference, maybe not. : D

Code:
    Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
            Application.DoEvents()  '' I'm reaching
        If WebBrowser1.DocumentTitle = "Sign in to your Microsoft account" And WebBrowser1.Url.ToString.StartsWith("https://login.live.com/") Then
            ClickTheSignUpButton()
        ElseIf WebBrowser1.DocumentTitle = "Sign up - Microsoft account" Then
            FillBoxesWithValues()
        ElseIf WebBrowser1.DocumentTitle.ToString.StartsWith("Outlook - " + TextBox3.Text) Then
            MsgBox("Your account has been successfully created and the details saved in the history tab")
        End If
    End Sub
- I think the 'best' solution is to create a thread for "background work" and leave the gui on it's own thread. But I was trying to avoid explaining threading and delegates and cross-thread exceptions etc etc: maybe we'll give that a go if you read up about it?
Quote Originally Posted by abuckau907 View Post
I'm not 100% on this, but if you set Timer.Enabled = false at the end of the timer_sub , it basically defeats the point of using a timer (ie. it will only execute 1 time...timers are meant to "repeat"), and is equivalent to just making a Sub.

Hmm..I'm not familiar with the webbrowser class, I could speculate, but that's all it would be.

I think maybe the problem is because web1.Navigate( ) won't let the gui update until the page is fully loaded. (ie. 1-3 seconds ?)

Now I'm just reaching..maybe this 1 line will make a noticeable difference, maybe not. : D

Code:
    Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
            Application.DoEvents()  '' I'm reaching
        If WebBrowser1.DocumentTitle = "Sign in to your Microsoft account" And WebBrowser1.Url.ToString.StartsWith("https://login.live.com/") Then
            ClickTheSignUpButton()
        ElseIf WebBrowser1.DocumentTitle = "Sign up - Microsoft account" Then
            FillBoxesWithValues()
        ElseIf WebBrowser1.DocumentTitle.ToString.StartsWith("Outlook - " + TextBox3.Text) Then
            MsgBox("Your account has been successfully created and the details saved in the history tab")
        End If
    End Sub
- I think the 'best' solution is to create a thread for "background work" and leave the gui on it's own thread. But I was trying to avoid explaining threading and delegates and cross-thread exceptions etc etc: maybe we'll give that a go if you read up about it?
Probably no point tbh chances of me understanding it will be close to none, doing very simple VB coding is pretty much far as i go before my brain gets confused lol. Thanks for your help though buddy i will keep looking.
Welcome. Yeah, afaik it's not really needed, I guess you could check any javascripts the page has to be sure. It's supposed to be "automated", so why slow it down with "Wait(1000)" anyway : D Good luck.
I have error with this program when i press autofill he is just fill username and give me a error message.

the error message is this
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.*********enceException: Object reference not set to an instance of an object.
at Steam_Account_Creator_Extreme.Form1.TextBox3_TextC hanged(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnTextChanged(EventAr gs e)
at System.Windows.Forms.TextBoxBase.OnTextChanged(Eve ntArgs e)
at System.Windows.Forms.TextBoxBase.WmReflectCommand( Message& m)
at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
at System.Windows.Forms.TextBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Steam Account Creator Extreme
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/AIRON~1/AppData/Local/Temp/Rar$EXa0.912/Steam%20Account%20Creator%20Extreme/Steam%20Account%20Creator%20Extreme.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 11.0.50709.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Quote Originally Posted by abuckau907 View Post
Welcome. Yeah, afaik it's not really needed, I guess you could check any javascripts the page has to be sure. It's supposed to be "automated", so why slow it down with "Wait(1000)" anyway : D Good luck.

I wanted to slow it the submission down to look human also there are some instances were i have to focus on an element and use sendkeys method to select someting as the getelementid does not work and having it run at fall speed trying to select and tab between multiple items messes up.
@samerlol - post any relevant code. Looks like TextBox3.Text was used with an empty value? Hard to tell, post code.

@OP I think SendKeys.SendWait () will "wait for the program to process the message", but haven't really tested much.
Posts 16–30 of 30 · Page 2 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us