Solved

C# how do I move a folder?

Posted on 2010-08-18
2
270 Views
Last Modified: 2013-12-17
I will have a folder called batch, in it there are other folders request1, request2, request3....
When a folder has been processed, I want to move it from batch to processed.
How can I do this?
Also, these folders will be very large.  Will there be an issue moving them if they are on the same level as batch?

so
batch .....processed on the same level

in batch there will be request1, 2, 3 ...
0
Comment
Question by:jackjohnson44
2 Comments
 
LVL 10

Accepted Solution

by:
Jini Jose earned 250 total points
ID: 33469960
is the folder having subdirectories ?

System.IO.Directory.Move(@"c:\batch\request1", @"C:\processed\request1");

Open in new window

0
 
LVL 14

Assisted Solution

by:systan
systan earned 250 total points
ID: 33470030
Moving a file or folder is the same as renaming it.

//Folder
System.IO.Directory.Move(@"c:\batch\request1", @"C:\processed\request1");

//File
System.IO.File.Move(@"c:\request.xml", @"c:\processing.xml");
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question