Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Rename Folder

Rename Folder

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-net
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dj rock
    wrote on last edited by
    #1

    Hi guys I am creating folder thru asp.net with help of System.IO.Directory.CreateDirectory("Name") Now i want to rename this directory. So some of members gave me suggestion to use System.IO.Directory.Move(OldFile,NewFile) But this is not working in my case as i am storing this in one location, So it is giving me error that "Source and destination path must be different." SO if any one have any idea please let me know Thanks in advance

    Regards, DJ Rock

    _ 1 Reply Last reply
    0
    • D dj rock

      Hi guys I am creating folder thru asp.net with help of System.IO.Directory.CreateDirectory("Name") Now i want to rename this directory. So some of members gave me suggestion to use System.IO.Directory.Move(OldFile,NewFile) But this is not working in my case as i am storing this in one location, So it is giving me error that "Source and destination path must be different." SO if any one have any idea please let me know Thanks in advance

      Regards, DJ Rock

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      But that seems to be OK. Are you giving both the parameters same?

      Best Regards, Apurva Kaushal

      D 1 Reply Last reply
      0
      • _ _AK_

        But that seems to be OK. Are you giving both the parameters same?

        Best Regards, Apurva Kaushal

        D Offline
        D Offline
        dj rock
        wrote on last edited by
        #3

        no i am giving file name different but it is at same place like i have following path D:/Folders/Temp1 and i want to rename Temp1 to Temp2 ok? so i am passing System.IO.Directory.Move("D:\Folders\" & oldName, "D:\Folders\" & NewName) Tell me is it ok?? then why it is giving me error like Must not be same path??::(

        Regards, DJ Rock

        _ 1 Reply Last reply
        0
        • D dj rock

          no i am giving file name different but it is at same place like i have following path D:/Folders/Temp1 and i want to rename Temp1 to Temp2 ok? so i am passing System.IO.Directory.Move("D:\Folders\" & oldName, "D:\Folders\" & NewName) Tell me is it ok?? then why it is giving me error like Must not be same path??::(

          Regards, DJ Rock

          _ Offline
          _ Offline
          _AK_
          wrote on last edited by
          #4

          But the same code is working fine for me.. :^)

          Best Regards, Apurva Kaushal

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups