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

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -