c# - how to A specific getfile These days -


foreach (string file in directory.getfiles(@"c:\tbank_file\in\adcode", "*.txt")) {     messagebox.show(path.getfilename(file)); } 

code me show message file in folder. want getfile specific today. file in folder me.

enter image description here

to specific file, example created today (inside foreach loop) can use 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 file    } 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -