- 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);
}
}
rusco_developer 02.03.2011 10:42 # −1
Решение: newVerFile.MoveTo(Path.Combine(destDir.F ullName, newVerFile.Name));
Lure Of Chaos 02.03.2011 13:28 # +1