从别人那里学习的,记下来以免忘了
FileInfo[] files = dir.GetFiles();
Array.Sort(files, (x1, x2) => int.Parse(Regex.Match(x1.Name, @"\d+").Value).CompareTo(int.Parse(Regex.Match(x2.Name, @"\d+").Value)));
foreach (FileInfo file in files)
{
listBox1.Items.Add(file.Name);
}