Solved

C# how do I move a folder?

Posted on 2010-08-18
2
268 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now