ASP.NET: Rename a directory
From Wiki
Summary: Rename a directory
Method 1
- Dim f As New System.IO.DirectoryInfo("path to directory..")
- f.MoveTo("new directory path and name")
Method 2 Another way to rename a directory would be to move it and then delete the original.
- Dim oldDirectory As String = "C:\Directory1"
- Dim newDirectory As String = "C:\Directory2"
- System.IO.Directory.Move(oldDirectory, newDirectory)
- System.IO.File.Delete(oldDirectory)
This Hack is part of the ASP.NET Hacks collection


