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. move Folder

move Folder

Scheduled Pinned Locked Moved ASP.NET
helpquestion
4 Posts 3 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.
  • A Offline
    A Offline
    AnhTin
    wrote on last edited by
    #1

    hi all i have problem with folder I have folder name "A" contain 10 file and 3 folder other and in there folder contain any file How can i move folder "A" to orther folder

    C A 2 Replies Last reply
    0
    • A AnhTin

      hi all i have problem with folder I have folder name "A" contain 10 file and 3 folder other and in there folder contain any file How can i move folder "A" to orther folder

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      In ASP.NET, you're not going to do any moving of files and folders at all, unless you need to do this on the server for some reason ?

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      • A AnhTin

        hi all i have problem with folder I have folder name "A" contain 10 file and 3 folder other and in there folder contain any file How can i move folder "A" to orther folder

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        /// <summary> /// Move Directory /// </summary> /// <param name="SourcPath">Source Directory </param> /// <param name="DestPath">Destination Directory</param> public void MoveDir(string SourcPath, string DestPath) { DirectoryInfo dirInfo = new DirectoryInfo(SourcPath); //FileSystemInfo finfo; string destiFile; if (!Directory.Exists(DestPath)) Directory.CreateDirectory(DestPath); foreach(FileSystemInfo finfo in dirInfo.GetFileSystemInfos()) { destiFile=Path.Combine(DestPath,finfo.Name); if ((FileSystemInfo)finfo is FileInfo) File.Move(finfo.FullName, destiFile); else MoveDir(finfo.FullName, destiFile); } } U can use this way, you need little bit of modification of code to remove the folder, else it working fine !!!!!

        Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"

        A 1 Reply Last reply
        0
        • A Abhijit Jana

          /// <summary> /// Move Directory /// </summary> /// <param name="SourcPath">Source Directory </param> /// <param name="DestPath">Destination Directory</param> public void MoveDir(string SourcPath, string DestPath) { DirectoryInfo dirInfo = new DirectoryInfo(SourcPath); //FileSystemInfo finfo; string destiFile; if (!Directory.Exists(DestPath)) Directory.CreateDirectory(DestPath); foreach(FileSystemInfo finfo in dirInfo.GetFileSystemInfos()) { destiFile=Path.Combine(DestPath,finfo.Name); if ((FileSystemInfo)finfo is FileInfo) File.Move(finfo.FullName, destiFile); else MoveDir(finfo.FullName, destiFile); } } U can use this way, you need little bit of modification of code to remove the folder, else it working fine !!!!!

          Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"

          A Offline
          A Offline
          AnhTin
          wrote on last edited by
          #4

          thanks

          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