Results 1 to 7 of 7

Thread: Make a small pause?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2011
    Posts
    8

    Make a small pause?

    Hey, i have a little project but ive come to an error. What it does: It goes to a site, fills a form and then submits it. But the submit is too fast. I want it to fill in info, then wait 3 seconds and then submit it.

    Here is the code:
    Code:
     WebBrowser1.Document.All("user[screen_name]").SetAttribute("value", TextBox4.Text & intcount)
    
                For Each element As HtmlElement In WebBrowser1.Document.All
                    If element.GetAttribute("className") = "submit button promotional" Then
                        element.InvokeMember("click")
                    End If
                Next
    I want it to have a little pause of 3 seconds after the intcount)
    Any ideas?

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Make a small pause?

    This part...
    Code:
    ...SetAttribute("value", TextBox4.Text & intcount)..
    Makes it look like you are iterating over a range of integers, submitting a form multiple times on a webpage. Is this the case?
    What are you hoping to achieve?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2011
    Posts
    8

    Re: Make a small pause?

    Yes, i am submitting a form multiple times. isnt this allowed? i tried adding System.Threading.Thread.Sleep(5000) But it will let the whole program stop for 5 seconds, then fill and submit again too fast. i need it inbetween:/

  4. #4
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Make a small pause?

    Well it does have a bad sound to it - I can not see a reason for needing this other than for spam or some kind of a primitive brute-force login utility.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2011
    Posts
    8

    Re: Make a small pause?

    Its not a force login, its just an account maker for a site. Isnt that allowed here?

  6. #6
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    Re: Make a small pause?

    Quote Originally Posted by danieldedaniel View Post
    Its not a force login, its just an account maker for a site. Isnt that allowed here?
    Stop doing it.

    Think about it. Spamming a web site to make accounts has absolutely no legitimate reason.
    "Ok, my response to that is pending a Google search" - Bucky Katt.
    "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
    "Before you can 'think outside the box' you need to understand where the box is."

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Make a small pause?

    Any malicious code is not allowed under the AUP. What you are writing may not be malicious in your mind, but I doubt it would be considered benign by the site managers.

    I should add that you can solve the problem pretty easily. Because of that, you should think about what you are doing. Some people really don't care about the consequences of their actions and whether it harms or annoys other people. There is a word for someone like that, the posting of which is also against the AUP. Is that who you want to be? If so, then you can solve your issue so easily that not answering the question makes no sense: Use a timer. There are so many answers to that basic question on the forum that not answering the question won't prevent somebody from doing something unkind. However, you shouldn't be doing that thing. Not because it is against somebody elses rule, but because it should be against your own.
    Last edited by Shaggy Hiker; Jun 13th, 2011 at 11:32 AM.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width