Rename a file in C#

Gold picture Gold · Jul 10, 2010 · Viewed 596.1k times · Source

How do I rename a file using C#?

Answer

Chris Taylor picture Chris Taylor · Jul 10, 2010

Take a look at System.IO.File.Move, "move" the file to a new name.

System.IO.File.Move("oldfilename", "newfilename");