Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- public static void Main(string[] args)
- {
- Console.WriteLine("Hello World!");
- // TODO: Implement Functionality Here
- Test(250);
- Test(500);
- Test(1000);
- Test(1500);
- Test(2000);
- Test(10000);
- Test(20000);
- Test(30000);
- Test(50000);
- Test(100000);
- Console.Write("Press any key to continue . . . ");
- Console.ReadKey(true);
- }
- static void Test (int size)
- {
- //string url = "http://127.0.0.1:9665/";
- string url = "http://192.168.1.47:9615/";
- int loop_count = size/10;
- for (int i=0; i<loop_count; i++)
- {
- url = url + "ABCDE12345";
- }
- Console.WriteLine("URL Request Length:" + url.Length);
- try
- {
- HttpWebRequest webrequest = (HttpWebRequest) WebRequest.Create(url);
- webrequest.KeepAlive = false;
- HttpWebResponse webresponse;
- webresponse = (HttpWebResponse)webrequest.GetResponse();
- Encoding enc = System.Text.Encoding.GetEncoding(1252);
- StreamReader loResponseStream = new StreamReader(webresponse.GetResponseStream(),enc);
- string Response = loResponseStream.ReadToEnd();
- Console.WriteLine(Response);
- }
- catch (Exception ex)
- {
- Console.WriteLine("Excetion: {0} stack: {1}", ex.Message, ex.StackTrace);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement