How to Rename a File

How to Rename a File? To Rename a file in C# is,

string path1 = @"c:\MyTest1.txt";
string path2 = @"c:\MyTest2.txt";


System.IO.File.Move(path1,path2);


To Rename a file in VB.Net is,

Dim path1 As String = "c:\MyTest1.txt"
Dim path2 As String = "c:\MyTest2.txt"


System.IO.File.Move(path1,path2)




No comments:

Post a Comment