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.
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.
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
}