Advertisement
BoDev

C# Proxy Scraper

Jan 17th, 2018
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. ////////////////////////////////////
  2. ///Proxy Scraper in c# made by Bo\\\
  3. ////////////////////////////////////
  4.  
  5. //This code is for getting the proxies:
  6. WebClient downloader = new WebClient;
  7. downloader.Encoding = Encoding.UTF8;
  8. string mystring = downloader.DownloadString("" + TextBox1.Text);
  9. string myregex = "\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b:\\d{2,5}";
  10. string source = mystring;
  11. MatchCollection findme = Regex.Matches(source, myregex);
  12. foreach (Match mymatch in findme)
  13. {
  14. ListBox1.Items.Add(mymatch);
  15. }
  16.  
  17. MsgBox("You scraped total of " + ListBox1.Items.Count.ToString + " proxies!");
  18. }
  19.  
  20. //this code is to save the proxies
  21. SaveFileDialog SetSave = new SaveFileDialog;
  22. int i;
  23. SetSave.Title = "Save SET.txt";
  24. SetSave.Filter = "SET.txt File (*.txt)|*.txt";
  25. if (SetSave.ShowDialog == Windows.Forms.DialogResult.OK)
  26. {
  27. IO.StreamWriter s = new IO.StreamWriter(SetSave.FileName, true);
  28. for (i = 0; i <= ListBox1.Items.Count - 1; i++)
  29. {
  30. s.WriteLine(ListBox1.Items.Item(i));
  31. }
  32.  
  33. s.Close();
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement