Advertisement
Metts

clanbase

Apr 10th, 2012
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.00 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Net;
  5. using System.IO;
  6.  
  7. namespace clanbase_ggl_com
  8. {
  9.     class Program
  10.     {  
  11.         //Coded by Metts - metts.blog.hu
  12.         static WebRequest wrGETURL;
  13.         static Stream objStream;
  14.         static StreamReader objReader;
  15.  
  16.         static string url = "http://clanbase.ggl.com/personlist.php?email=";
  17.         static string file;
  18.         static List<string> list = new List<string>();
  19.  
  20.         static string email;
  21.         static string get;
  22.         static void Main(string[] args)
  23.         {
  24.             Console.WriteLine("////////---Coded by Metts - metts.blog.hu---////////");
  25.             Console.Write("File (file.txt): ");
  26.             file = Console.ReadLine();
  27.             if (!File.Exists(file))
  28.             {
  29.                 Console.WriteLine("File not exists");
  30.                 Console.ReadLine();
  31.             }
  32.             else
  33.             {
  34.                 using (StreamReader sr = new StreamReader(file))
  35.                 {
  36.                     while (sr.Peek() >= 0)
  37.                     {
  38.                         list.Add(sr.ReadLine());
  39.                     }
  40.                 }
  41.  
  42.                 int all = list.Count;
  43.                 Console.WriteLine("\nProgram Start \nLinenumber: " + list.Count);
  44.                 for (int i = 0; i < list.Count; i++)
  45.                 {
  46.                     email = list[i];
  47.                     get = url + "" + email;
  48.                     Console.WriteLine("------------------------------------------------------------------------------");
  49.                     Console.WriteLine("ID   : " + i);
  50.                     Console.WriteLine("LINK : " + get);
  51.                     Console.WriteLine("EMAIL: " + email);
  52.                     Console.Write("ISSET: ");
  53.                     try
  54.                     {
  55.                         wrGETURL = WebRequest.Create(get);
  56.                         objStream = wrGETURL.GetResponse().GetResponseStream();
  57.                         objReader = new StreamReader(objStream);
  58.                         string end = objReader.ReadToEnd();
  59.                         if (end.Contains("No players matching criteria "))
  60.                             Console.WriteLine("false");
  61.                         else
  62.                         {
  63.                             Console.WriteLine("true");
  64.                             Console.WriteLine(email);
  65.                             File.AppendAllText("output.txt", email + "\n");
  66.                             all++;
  67.                         }
  68.                     }
  69.                     catch (Exception e)
  70.                     {
  71.                         Console.WriteLine("The process failed: {0}", e.ToString());
  72.                     }
  73.                     Console.WriteLine("------------------------------------------------------------------------------");
  74.                 }
  75.                 Console.WriteLine("END ({0}/{1})", list.Count, all);
  76.                 Console.ReadLine();
  77.             }
  78.         }
  79.        
  80.     }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement