|
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.
|
|
|
|
|
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-<whatever> 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?
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
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?
|
|
|
|
|
|
John, really great resources for reviewing! Thanks so much!
|
|
|
|
|
Hi,
Guys I need your guidance..
I have MdiForm with a progress bar. when I save on a child form, I want to have the progress bar to show the saving progress.
To be more clearer, when I click save_button on a child from, the bar should show progress and then reset after the saving method is done.
Thanks
|
|
|
|
|
Add a Statusbar to your MdiForm and show the progressbar on the statusbar when saving.
Tosch
|
|
|
|
|
Hi,
I have added statusbar to MdiForm also a progressBar..when I load a parent form from the MdiForm, on load event I also load the progressBar, it works, but when I save on a child form, I can't do it..
thanks advance
|
|
|
|
|
How to close all open forms without current and startup forms?
|
|
|
|
|
Get the list of open forms by Application.OpenForms collection. Then, identify the current form and the start up one from the list. Close the rest of them. You can identify current one by matching the name or something and same goes for the start up form.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hi,
In my application - I need to search for installed SQL Server instances on the wotkstation or network; so I can create the appropriate connection string and also for allowing the user to install sql server express if no sql server is installed.
Is there any way?
Thanks,
Ekjon
|
|
|
|
|
Check out SqlDataSourceEnumerator class. That will help you getting the list of SQL server instances on the network.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
u can use sqldatasourceenumerator to get the available sql instances
like
Dim dt As New DataTable
dt= Sql.SqlDataSourceEnumerator.Instance.GetDataSources
DataGridView1.DataSource = dt.AsDataView
|
|
|
|
|
Thanks d@nish and Dambod - it was very helpful.
|
|
|
|
|
Hi there,
I am currently trying to generate a report based on crystal report 10. In my report there are some parameters that should be displayed only once, some parameter for every record but some only a few times. Here is what i did, I put those parameters that will be
1. displayed once on the page headers
2. displayed for every record from the database in details section, and I used GROUPING for others.
Name____Col1_____Col2____Col3____Time
______________________________Dias_Horas_Minutos
SUBAREA_a
X____test____AAAA____AAAA1____1____2____3
Y____test____BBBB_____BBBB1____3____2____1
_____________________Subtotal____4____4____4
SUBAREA_b
X____test____AAAA____AAAA1____1____2____3
Y____test____BBBB____BBBB1____3____2____1
_____________________Subtotal____4____4____4
SUBAREA_c
X____test____AAAA____AAAA1____1____2____3
Y____test____BBBB____BBBB1_____3____2____1
_____________________Subtotal____4____4____4
_____________________TOTAL____12____12____12
My question is that possible to have a sub-grouping with grouping in Crystal report?
with regards,
modified on Wednesday, October 21, 2009 10:49 AM
|
|
|
|
|
Hello everyone
I am sure this is somting simple but i cant figuer it out
how you can you have a button click a button ???
say
when you click button 1 it will be like clicking button 2 button 3 at the same time ??
Thanks
Bob
|
|
|
|
|
Just call them;
Private Sub Button1_Click(sender As Object, e As EventArgs)
Button2_Click(Nothing, EventArgs.Empty)
Button3_Click(Nothing, EventArgs.Empty)
End Sub
I are Troll
|
|
|
|
|
Why not have a single handler for all the buttons? Then you can wisely put some conditions so that only a particular code is fired depending on the button clicked.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
I like Danish's method
Private Sub ClickAllButtons(sender As Object) Handles Button1.Click, _
Button2.Click, Button3.Click
Dim btn As Button = Nothing
If TypeOf sender Is Button Then
btn = DirectCast(sender, Button)
If btn.Name = "Button1" Then
callButton1Stuff()
callButton2Stuff()
callButton3Stuff()
ElseIf btn.Name = "Button2" Then
callButton2Stuff()
Else
callButton3Stuff()
End
Else
' Maybe a good idea to do something here.
Exit Sub
End
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Right on guys thanks a lot
|
|
|
|
|
|
You should have posted it in General database[^] forum.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hello,
I am programming in VB2005.
I have a Form1 and Class A:
a) In Form1, I have a Picturebox (Name=PictureBox1)
b) Class A inherits from PictureBox
I am trying the following but the Picturebox1 does not display anything:
Dim MyA As New A(PictureBox1.Width, PictureBox1.Height)
MyA.Location = New System.Drawing.Point(150, 150)
MyA.BackColor = Color.Red
PictureBox1 = MyA
Why doesn't it works?
I have an alternative to solve the problem but I would like to understood the problem above.
Alternative sdolution:
Dim MyA As New A(500, 350)
MyA.Location = New System.Drawing.Point(150, 150)
MyA.BackColor = Color.Red
controls.add(MyA)
Shay Noy
|
|
|
|