Hi,
I put this code in a windows forms app for testing. The IP values are both
correct. It works the first time, the second time but at the third time it
fails with timeout... I have it running here AND in a service with a 30
minute interval.
1. Am I doing this correclty? Is there a better way to go to a URI and pass
a couple of variables?
2. If I am doing this correctly any idea why it would be timing out on the
third time onwards? The ASP page just takes the values and writes them to a
DB. If I run it in a browser I can run it over and over with no timeouts...I
think it must be something that I am doing but I can't thing what.
Can someone help?
Tim
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
static System.Timers.Timer timer = new System.Timers.Timer(5000);
public Form1()
{
InitializeComponent();
timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
timer.Start();
}
static void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
timer.Stop();
Console.WriteLine("Timer Elapsed");
System.Net.WebRequest req =
System.Net.WebRequest.Create(http://24.36.xxx.xxx/server/update_i...7.70.xxx.xxx);
req.GetResponse();
Console.WriteLine("Done");
Console.WriteLine();
timer.Start();
}
}
}