More
Image
Rename Files in C sharp
By JC.Adinarayana Reddy On 20 Dec 2016
Categories: C#.net
There is no separate method for renaming files in .NET. For the purpose of renaming files we can use MOVE() method as in below example
string path = "~/Tiles/";
string FromFile = path+"old.jpg";
string ToFile = path + "new.jpg";
if (File.Exists(Server.MapPath(FromFile)))
File.Move(Server.MapPath(FromFile), Server.MapPath(ToFile));

 


Comments
Message :
Comments
JC.Adinarayana Reddy
.net
.net