delete files which are more than one month old using c# -


How to delete files older than one month using C # script I am using Frame 2.0.

  string path = @ "C: \ temp \"; // "Directory Info dirInfo = new DirectoryInfo (path); FileInfo [] fileInfos = dirInfo.GetFiles (); foreach (fileInfo fileInfos in fileInfos) {if (fileInfo.LastWriteTime & date; DateTime.Now.AddMonths (-1)) fileInfo Delete ();}  

Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -