Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string path = @"F:\Riot Games\League of Legends - Copy\Logs\Game - R3d Logs";
- string SummonerName = "Mandrakiane";
- Regex reg = new Regex( @"Hero (\w+)\(?[0-9]?\)? created for " + SummonerName);
- Dictionary<String, int> Counters = new Dictionary<String, int>();
- foreach (string log in Directory.EnumerateFiles(path))
- {
- try
- {
- foreach (string line in File.ReadAllLines(log))
- {
- Match mt = reg.Match(line);
- if (mt.Success)
- {
- if (Counters.ContainsKey(mt.Groups[1].Value))
- {
- Counters[mt.Groups[1].Value]++;
- }
- else
- Counters[mt.Groups[1].Value] = 1;
- }
- }
- }
- catch (IOException ex)
- {
- }
- }
- Counters.OrderByDescending(p => p.Value).Dump();
Advertisement
Add Comment
Please, Sign In to add comment