using System.Text.RegularExpressions;
using System.Collections.Generic;
public static void Main()
string rpath = Directory.GetParent(Properties.Settings.Default.game_path).FullName + "\\Data";
DirectoryInfo di = new DirectoryInfo(rpath);
List<long> currentpatchlength = new List<long>();
var regex = new Regex(@"\b[0-9]{4}\b");
FileInfo[] Currentpatchs = di.GetFiles("*.mpq").Where(fi => regex.Match(fi.ToString()).Success).ToArray();
foreach (FileInfo f in Currentpatchs)
long Length = (f.Length / 1024);
currentpatchlength.Add(Length);
private void btnUpdate_Click(object sender, EventArgs e)