09/02/17 15:05:13
>>582
パス名の文字列を正規表現で分解して年と月を別々に取り出す
あとは大小比較で絞込み
Regex r;
r = new Regex(@"(\d{4})(\d{2})\d{2}eventname", RegexOptions.IgnoreCase);
Match m;
m = r.Match(@"c:/photo/20080407eventname/photo.jpg");
if (m.Success) {
String year = m.Groups[1].Value;
String month = m.Groups[2].Value;
Console.WriteLine("{0}年{1}月", year, month);
}