HORNSWOGGLE
C++ Beginner
Hallo,
Wie kann ich mit dem Timer alle 60 min einen Link öffnen lassen
Wie kann ich mit dem Timer alle 60 min einen Link öffnen lassen
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
System.Diagnostics.Process.Start("http://www.google.de")
Deswegen, weil das Intervall in Millisekunden angegeben werden muss.
1 sek = 1000 msek * 60 = 1 min * 60 = 1h --> 1h = 3600000 msek
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
tmr1 = tmr1 + 1
TextBox1.Text = tmr1
If tmr1 = 10 Then
a = a + 1
tmr1 = 0
End If
If a = 60 Then
b = b + 1
a = 0
End If
If b = 60 Then
c = c + 1
b = 0
End If
///////////////////Habe ich hinzugefügt\\\\\\\\\\\\\\\\\\\\\\\
If b = 1 Then
System.Diagnostics.Process.Start("http://www.www.de")
End If//////////////////////////////////////////////////////////////////////////////////////////
TextBox2.Text = a
TextBox3.Text = b
TextBox4.Text = c
End Sub
' [...]
If b = 1 Then
System.Diagnostics.Process.Start("http://www.www.de")
b = irgendwas ' ...
End If
' [...]
If b = 1 Then
System.Diagnostics.Process.Start("http://www.www.de")
b = 0
End If
public partial class FormMain : Form
{
public FormMain()
{
InitializeComponent();
timer = new Timer();
timer.Tick += new EventHandler(timer_Tick);
timer.Interval = 1000;
timer.Enabled = true;
start = DateTime.Now;
}
void timer_Tick(object sender, EventArgs e)
{
TimeSpan span = DateTime.Now - start;
string tmp = span.ToString();
textBox.Text = tmp.Substring(0, tmp.LastIndexOf('.'));
if (span.TotalMinutes == 60)
{
Process.Start("calc.exe");
start = DateTime.Now;
}
}
private Timer timer;
private DateTime start;
}