1) Rename a File in C#.net
string path = @"C:\Documents and Settings\Narayanan\My Documents\Others\Txt\test\";
string Orgifile = path + "\\Test.txt";
string Renamefile = path + "\\Test1.txt";
File.Move(Orgifile, Renamefile);
2) Rename a Folder in C#.net
string Orgifile = path + "\\Test.txt";
string Renamefile = path + "\\Test1.txt";
File.Move(Orgifile, Renamefile);
string path = @"C:\Documents and Settings\Narayanan\My Documents\Others\Txt";
string OriFolder = path + "\\test";
string RenameFolder = path + "\\Test1.txt";
Directory.Move(OrgiFolder, RenameFolder);
string OriFolder = path + "\\test";
string RenameFolder = path + "\\Test1.txt";
Directory.Move(OrgiFolder, RenameFolder);