SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,560 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When I rename a file it drops the extension and I can't open it programmatically. How do you keep the extension? When I set a break point it includes the extension by checking in the immediate window. It's not included in the file name in the directory and I get an error Cannot open datafile.
string oldFile = "C:\New folder\";
string newFile = "C:\Sales\";
foreach(file f in Files)
{
System.IO.File.Move(oldFile + f.Name, newFile + f.Name + "New");
}
HI @Winston TheFifth ,
Please try the following.
c#
File.Move(Path.Combine(oldFile, f.Name), Path.Combine(newFile, Path.GetFileNameWithoutExtension(f.Name) + "New" + Path.GetExtension(f.Name)));