Skip to content

Instantly share code, notes, and snippets.

@statianzo
Created April 8, 2010 20:22
Show Gist options
  • Save statianzo/360495 to your computer and use it in GitHub Desktop.
Save statianzo/360495 to your computer and use it in GitHub Desktop.
using System;
using System.Net;
using System.Threading;
internal class Program
{
private static void Main(string[] args)
{
Random random = new Random();
for (int i = 0; i < 25; i++)
{
ThreadPool.QueueUserWorkItem(x =>
{
while (true)
{
WebRequest webRequest =
WebRequest.Create("http://localhost:43157/FileProvider/GetFile?fileName=FileName" + random.Next(1000));
var response = webRequest.GetResponse() as HttpWebResponse;
if ((int)response.StatusCode > 200)
throw new Exception("Bad news here");
Console.WriteLine(response.StatusCode);
}
});
}
Console.ReadLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment