我想根据c#中的日期返回30张图片 可能吗 ? 像那样
Bitmap bmp = new Bitmap(DateTime.Now.ToString().Substring(0, 2).ToString() + ".png");
答案 0 :(得分:0)
尝试这样的事情
const string FOLDER = @"c:\temp";
static void Main(string[] args)
{
DirectoryInfo info = new DirectoryInfo(FOLDER);
FileInfo[] files = info.GetFiles("*.png", SearchOption.TopDirectoryOnly);
DateTime today = DateTime.Now;
string[] filteredFiles = files.Where(x => x.LastWriteTime >= today.AddDays(-30)).Select(y => y.FullName).ToArray();
}