by Heathesh
1. October 2009 03:13
Only one way
There seems to only be one way to change a file extension in .Net. This is:
string ourPath = @"c:\test.txt";
string newPath = Path.ChangeExtension(ourPath, "bak");
File.Move(ourPath, newPath);
File system entry modified
This apparently doesn't copy the file, only the file system entry is modified which should mean there should be a performance degradation when you do this.