Is there any function to change the file extension in .NET? Or do I need to rename the file? thanks
As an example, I want to rename each file to a directory with the extension .resxx to .resx. what is the problem with my code?
Dim [option] Like SearchOption = SearchOption.AllDirectories [option] = SearchOption.AllDirectories
Dim fileNames As String() = Directory.GetFiles("C:\New Folder", "*.resxx", [option]) For Each f In fileNames Dim t As New FileInfo(f.ToString) MsgBox(Mid(f, 1, f.Length - 4)) t.MoveTo(Mid(f, 1, f.Length - 4) + ".resx") Next
source share