Solved

Web Browser Windows

Posted on 2006-07-04
4
172 Views
Last Modified: 2010-04-30
I need an application to test a case study and am in dire need of help, seeing as my knowledge of computer programming is lacking in sustenance. Help would be very much appreciated! I need a program that generates a random string that is 10 letters long and then opens it as a url in a web browser. This process should be repeated at random intervals of time.
Thanks for all your help experts!
0
Comment
Question by:momonja
4 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 165 total points
ID: 17036104
for the random string you would need something like

randomize timer

public function retStr(chrLen as long) as string
dim lngLc as long

retStr = ""

for lngLc = 1 to 10
    retstr = retstr & chr(cint(round(rnd() * 25 + 1)) + 65)
next lnglc

end function

for the random timer interval what I would do is have a timer on your form set to check every 1 second
I would have a global variable which was of a date - initilised to the current time on form load.

then when the timer event is triggered i would check if now() > timeVariable

when you have finished opening the url i would set timeVariable = dateadd("s", round(rnd()*500), now()) which would add a random number of seconds to the current time (between 0 and 500)

Finally for the opening of the url in a browser - you can use the internetExplorer object

like

    Set objIE = New InternetExplorer
    objIE.Visible = True
    objIE.navigate "http://www.yourpage.com"
    While objIE.readyState <> READYSTATE_COMPLETE
        DoEvents
    Wend
    Dim objHTML As HTMLDocument
    Set objHTML = objIE.document
    While objHTML.readyState <> "complete"
        DoEvents
    Wend

there is plenty of stuff if you google the InternetExplorer object
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now