Solved

Web Browser Windows

Posted on 2006-07-04
4
171 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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

763 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

11 Experts available now in Live!

Get 1:1 Help Now