Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Looping Website Viewer?

Looping Website Viewer?

Scheduled Pinned Locked Moved Visual Basic
cssquestion
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    teknozwizard
    wrote on last edited by
    #1

    Say I wanted to create a small program that automatically rotated between websites every X seconds, where would I need to start? For instance, I create a simple form, it has 2 buttons. A start and a stop button. The stop button just quits the program completely, so I'm using the Me.Close() function for that, so I'm not worried about that. However, I want the start button to do something like.....open Google in Internet Explorer, and after say...45 seconds, rotate to Yahoo, and then another 45 seconds, rotate to MSN, and so forth and so on. Now, say I wanted the rotations to be less than 2 minutes, but more than 30 seconds, where would I start there? Would I use the Do/Loop functions?

    C 1 Reply Last reply
    0
    • T teknozwizard

      Say I wanted to create a small program that automatically rotated between websites every X seconds, where would I need to start? For instance, I create a simple form, it has 2 buttons. A start and a stop button. The stop button just quits the program completely, so I'm using the Me.Close() function for that, so I'm not worried about that. However, I want the start button to do something like.....open Google in Internet Explorer, and after say...45 seconds, rotate to Yahoo, and then another 45 seconds, rotate to MSN, and so forth and so on. Now, say I wanted the rotations to be less than 2 minutes, but more than 30 seconds, where would I start there? Would I use the Do/Loop functions?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      This is trivial. Just use a timer.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      T 1 Reply Last reply
      0
      • C Christian Graus

        This is trivial. Just use a timer.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        T Offline
        T Offline
        teknozwizard
        wrote on last edited by
        #3

        So glad this is trivial to an expert like yourself. However, being a beginner, the question still begs to differ. So, I go to using a timer, that's fine, but where do I begin? How do I launch the websites and make them rotate? Which function do I do? Obviously it won't be a Do- function. Where would you suggest I start? And since it's trivial, let's do it this way. I want to make the timers connect to and then jump through using proxy. I.E., when the program is first launched, I want it to connect to a predefined proxy server and run through all the websites one time. Then on it's return path (or loop if you will), I want it to connect to a second predefined proxy server and have it run through the websites like that, so forth and so on. Any suggestions for that?

        J 1 Reply Last reply
        0
        • T teknozwizard

          So glad this is trivial to an expert like yourself. However, being a beginner, the question still begs to differ. So, I go to using a timer, that's fine, but where do I begin? How do I launch the websites and make them rotate? Which function do I do? Obviously it won't be a Do- function. Where would you suggest I start? And since it's trivial, let's do it this way. I want to make the timers connect to and then jump through using proxy. I.E., when the program is first launched, I want it to connect to a predefined proxy server and run through all the websites one time. Then on it's return path (or loop if you will), I want it to connect to a second predefined proxy server and have it run through the websites like that, so forth and so on. Any suggestions for that?

          J Offline
          J Offline
          John M Bundy
          wrote on last edited by
          #4

          Have a list of the sites you want to visit in an arraylist, have an integer that will increment from 0 to arraylist.count-1, then put on a timer and set the interval to 45 seconds, then on the timers .tick event navigate to the url stored in arraylist(integer you are incrementing), increment integer. I will try to post some code when i get the chance

          J 1 Reply Last reply
          0
          • J John M Bundy

            Have a list of the sites you want to visit in an arraylist, have an integer that will increment from 0 to arraylist.count-1, then put on a timer and set the interval to 45 seconds, then on the timers .tick event navigate to the url stored in arraylist(integer you are incrementing), increment integer. I will try to post some code when i get the chance

            J Offline
            J Offline
            John M Bundy
            wrote on last edited by
            #5

            Ok so i got the code done quickly :) Add a webbrowser control, a timer, and a button. Set the timer at the interval you want. If you want a stop button, just add one with Me.Timer1.Stop, thats it.

            Public Class Form1
            Dim siteCount As Integer = 0
            Dim aList As New ArrayList
            Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            aList.Add("http://www.jmbundy.blogspot.com/")
            aList.Add("http://www.codeproject.com/Messages/3244826/Re-Looping-Website-Viewer.aspx")
            aList.Add("http://www.google.com/webhp?sourceid=navclient&ie=UTF-8")
            End Sub
            Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Me.Timer1.Start()
            End Sub
            Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            Me.WebBrowser1.Navigate(Me.aList(siteCount))
            If siteCount + 1 <= Me.aList.Count - 1 Then
            siteCount += 1
            Else : siteCount = 0
            End If
            End Sub
            End Class

            T 1 Reply Last reply
            0
            • J John M Bundy

              Ok so i got the code done quickly :) Add a webbrowser control, a timer, and a button. Set the timer at the interval you want. If you want a stop button, just add one with Me.Timer1.Stop, thats it.

              Public Class Form1
              Dim siteCount As Integer = 0
              Dim aList As New ArrayList
              Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
              aList.Add("http://www.jmbundy.blogspot.com/")
              aList.Add("http://www.codeproject.com/Messages/3244826/Re-Looping-Website-Viewer.aspx")
              aList.Add("http://www.google.com/webhp?sourceid=navclient&ie=UTF-8")
              End Sub
              Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
              Me.Timer1.Start()
              End Sub
              Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
              Me.WebBrowser1.Navigate(Me.aList(siteCount))
              If siteCount + 1 <= Me.aList.Count - 1 Then
              siteCount += 1
              Else : siteCount = 0
              End If
              End Sub
              End Class

              T Offline
              T Offline
              teknozwizard
              wrote on last edited by
              #6

              This is a wonderful solution and is greatly appreciated. Now all I have to do is figure out how to make it jump through proxies. I'm wondering, could I use the GetStream() function to try and make it jump through proxies?

              J 1 Reply Last reply
              0
              • T teknozwizard

                This is a wonderful solution and is greatly appreciated. Now all I have to do is figure out how to make it jump through proxies. I'm wondering, could I use the GetStream() function to try and make it jump through proxies?

                J Offline
                J Offline
                John M Bundy
                wrote on last edited by
                #7

                Not sure, never tried but look at this link, has code included. http://www.dreamincode.net/forums/showtopic53244.htm[^]

                T 1 Reply Last reply
                0
                • J John M Bundy

                  Not sure, never tried but look at this link, has code included. http://www.dreamincode.net/forums/showtopic53244.htm[^]

                  T Offline
                  T Offline
                  teknozwizard
                  wrote on last edited by
                  #8

                  John, really great resources for reviewing! Thanks so much!

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups