There is no File.Rename method in VB.NET.

There is a File.Delete method. And there’s a File.Create and File.Copy and File.Open. But to Rename a File you have to use File.Move.

For example:

  If File.Exists(NewFilePath) = True Then      File.Move(NewFilePath, FilePath)  Else      lblMessage.Text = "Error Renaming Resized File"  End If


In this case, NewFilePath and FilePath are in the same folder, they just have different file names.