- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
DirectoryInfo dir = new DirectoryInfo(@"C:\Users\origLocation\");
DirectoryInfo destDir = new DirectoryInfo(@"C:\Users\origLocation\destLocation\");
FileInfo[] newVerFiles = dir.GetFiles("*.TXT");
foreach (FileInfo newVerFile in newVerFiles)
{
Regex regex = new Regex("\\d+-new-ver.TXT", RegexOptions.IgnoreCase);
if (regex.IsMatch(newVerFile.Name))
{
newVerFile.MoveTo(destDir.FullName);
}
}