Directory.GetFiles get today's files only

前端 未结 7 696
青春惊慌失措
青春惊慌失措 2021-01-04 01:02

There is nice function in .NET Directory.GetFiles, it\'s simple to use it when I need to get all files from directory.

Directory.GetFiles(\"c:\\\\Files\")
<         


        
7条回答
  •  佛祖请我去吃肉
    2021-01-04 01:44

    You should be able to get through this:

    var loc = new DirectoryInfo("C:\\");
    
    
    var fileList = loc.GetFiles().Where(x => x.CreationTime.ToString("dd/MM/yyyy") == currentDate);
    foreach (FileInfo fileItem in fileList)
    {
        //Process the file
    }
    

提交回复
热议问题