Solved

Web Browser Windows

Posted on 2006-07-04
4
173 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

776 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