Guest User

Untitled

a guest
Jul 22nd, 2013
1,517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. string path = @"F:\Riot Games\League of Legends - Copy\Logs\Game - R3d Logs";
  2. string SummonerName = "Mandrakiane";
  3. Regex reg = new Regex( @"Hero (\w+)\(?[0-9]?\)? created for " + SummonerName);
  4. Dictionary<String, int> Counters = new Dictionary<String, int>();
  5.  
  6. foreach (string log in Directory.EnumerateFiles(path))
  7. {
  8. try
  9. {
  10. foreach (string line in File.ReadAllLines(log))
  11. {
  12. Match mt = reg.Match(line);
  13. if (mt.Success)
  14. {
  15. if (Counters.ContainsKey(mt.Groups[1].Value))
  16. {
  17. Counters[mt.Groups[1].Value]++;
  18. }
  19. else
  20. Counters[mt.Groups[1].Value] = 1;
  21. }
  22.  
  23. }
  24. }
  25. catch (IOException ex)
  26. {
  27. }
  28.  
  29.  
  30. }
  31. Counters.OrderByDescending(p => p.Value).Dump();
Advertisement
Add Comment
Please, Sign In to add comment