Click here to Skip to main content
15,910,980 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to know how to rename a file in C#8.0
Posted
Comments
[no name] 7-Mar-13 9:24am    
What have you tried? Have you possibly looked at the documentation for File.Copy?
Sergey Alexandrovich Kryukov 7-Mar-13 14:34pm    
No, not Copy. File.Move.
—SA
__TR__ 7-Mar-13 9:29am    
See here[^]

Try:
C#
File.Move(oldPath, newPath);
 
Share this answer
 
Below is what I found when I looked at the Visual Studio Help file documentation.

In the .NET Framework documentation, Common I/O Tasks[^] lists things you might want to do to a file. This is a good page to add to your favorites.

For rename, the documentation says to use the File.Move Method[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900