I am not good at c#. I got script task that deletes the existing file from directory, I got variable that holds both directory value and file value. how can I use those variable values in this code?:
public void Main()
{
// TODO: Add your code here
string directoryPath = @"\\sql\sqlfiles;
string[] oldFiles = System.IO.Directory.GetFiles(directoryPath, "MYDBFULL_*.bak");
foreach (string currFile in oldFiles)
{
FileInfo currFileInfo = new FileInfo(currFile);
currFileInfo.Delete();
}
Dts.TaskResult = (int)ScriptResults.Success;
}
I want to use variable value here at @"\\sql\sqlfiles
and MYDBFULL_*.bak
Thnak you in advance