Example #1
0
 private static async Task <String> LoadStringAsync(String url, LeakType type)
 {
     if (!Leaker.ContainsKey(type))
     {
         Int32 rate = type == LeakType.Amazon ? 1 : 8; ///I believe everyone but Amazon can handle 8-10 per second
         Leaker[type] = new SlowLeak(rate, 1000);
     }
     using (WebClient wc = new WebClient())
     {
         Leaker[type].CheckLeak();
         return(await wc.DownloadStringTaskAsync(url));
     }
 }
Example #2
0
 private static async Task<String> LoadStringAsync(String url, LeakType type)
 {
     if (!Leaker.ContainsKey(type))
     {
         Int32 rate = type == LeakType.Amazon ? 1 : 8; ///I believe everyone but Amazon can handle 8-10 per second
         Leaker[type] = new SlowLeak(rate, 1000);
     }
     using (WebClient wc = new WebClient())
     {
         Leaker[type].CheckLeak();
         return await wc.DownloadStringTaskAsync(url);
     }
 }