--// You need to apply below one line in "namespaces" region. using System.IO; --//You need to apply below lines inplace of // TODO: Add your code here string directoryPath = @"E:\TestFolder"; string[] oldFiles = System.IO.Directory.GetFiles(directoryPath, "*.txt"); foreach (string currFile in oldFiles) { FileInfo currFileInfo = new FileInfo(currFile); currFileInfo.Delete(); }
Tags: sql, sql server, ms sql, ms sql server, #SQL Server, #sql, database, sql server general, SQL Scripts, SSIS, SSDT,