How to change the name of a file?

Hi,
my problem is really simple but i don't get a solution.
I simple want to change the name of a file.
Can someone help me



Answer this question

How to change the name of a file?

  • hrubesh

    Thank you. I thought there would be an extra method for renaming.

  • arkiboys

    Hi,

    you can use File.Move() method. The following line will rename c:\a.txt to c:\b.txt:

    System.IO.File.Move("c:\\a.txt", "c:\\b.txt");

    Andrej



  • How to change the name of a file?