Nu skriver den slet ingen fejl.
Men den virker så heller ikke.
der sker intet.
private bool isThreadToRun;
public Form1()
{
InitializeComponent();
}
private void testBtn_Click(object sender, EventArgs e)
{
if (startBtn.Text == "Start")
{
startBtn.Text = "Stop";
isThreadToRun = true;
Thread newThread = new Thread(new ThreadStart(EndlessLoop));
newThread.Start();
}
else
{
startBtn.Text = "Start";
isThreadToRun = false;
}
}
private void EndlessLoop()
{
string[] linkUrl = { "http://simonsblog.dk", "http://itstedet.dk", "http://efterskolecentrum.dk", "http://f1media.dk/" };
int max = linkUrl.Length;
int i;
//int max = listUrlsBox.Text.Length;
while (isThreadToRun)
{
for (i = 0; i <= max - 1; i++)
{
SendMSNMessage(true, "office", linkUrl[i]);
//SendMSNMessage(true, "office", listUrlsBox.Text[i]);
Thread.Sleep(1000);
}
}
}