Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Renaming a file programatically

Status
Not open for further replies.

DayLaborer

Programmer
Joined
Jan 3, 2006
Messages
347
Location
US
What would the few lines of code be to programatically rename a specific file using C#?

Thanks,
Eliezer
 
File.Move(@"C:\MyFile.txt", @"C:\MyNewerFile.txt");
 
There is File.Copy, File.Move, but not File.Rename How do you rename a file in a similar manner?
Eliezer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top