-1
foreach (string file in Directory.GetFiles(@"C:\tbank_file\in\ADCODE", "*.txt"))
{
    MessageBox.Show(Path.GetFileName(file));
}

code me is Show message all file in folder. i want getfile A specific today. file in folder me.

enter image description here

Rufus L
  • 36,127
  • 5
  • 30
  • 43
  • Please check this https://stackoverflow.com/a/13865777/1849024 – imsome1 Sep 12 '17 at 05:36
  • 1
    It is hard to get what exactly you are looking for... perhaps you can use Google Translation or similar to make your question a bit more clear? – Rob Sep 12 '17 at 06:27

1 Answers1

0

To get an specific file, for example created today (inside your foreach loop) You can use another properties in GetCreationTime or GetLastWriteTime

for more information:

https://msdn.microsoft.com/en-us/library/system.io.file(v=vs.110).aspx

  if (File.GetCreationTime(file).DayOfYear == DateTime.Now.DayOfYear)
  {
        // return your file 
  }
Thiago Loureiro
  • 1,041
  • 13
  • 24