Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Community Wiki

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Navigation

Google Ads

ASP.NET: Rename a directory

From Wiki

Jump to: navigation, search


Summary: Rename a directory

Method 1

  1. Dim f As New System.IO.DirectoryInfo("path to directory..")
  2. 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.

  1. Dim oldDirectory As String = "C:\Directory1"  
  2. Dim newDirectory As String = "C:\Directory2"  
  3. System.IO.Directory.Move(oldDirectory, newDirectory)  
  4. System.IO.File.Delete(oldDirectory)


This Hack is part of the ASP.NET Hacks collection

453 Rating: 3.0/5 (6 votes cast)