protected override void OnLoad(EventArgs e) { base.OnLoad(e); string on = @"C:\PathOldFolder"; string nn = @"C:\PathNewFolder"; Directory.CreateDirectory(nn); this.Copy(new DirectoryInfo(on), new DirectoryInfo(nn)); } public void Copy(DirectoryInfo o, DirectoryInfo n) { foreach (FileInfo f in o.GetFiles()) { string nfn = f.FullName.Replace(o.FullName, n.FullName); File.Copy(f.FullName, nfn); } foreach (DirectoryInfo c in o.GetDirectories()) { string ndn = c.FullName.Replace(o.FullName, n.FullName); Directory.CreateDirectory(ndn); this.Copy(c, new DirectoryInfo(ndn)); } }
Thursday, August 12, 2010
How to copy all files in one folder to another folder.
Subscribe to:
Post Comments (Atom)
Azure Storage Account Types
Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...
-
Why we need asynchronous tasks? Execute a time consuming operations in parallel to the CLR thread which execute the request If you have ...
-
Demo: I was thinking a way to show images before actually uploading them to server. I would say to preview images using javascript. Obv...
No comments:
Post a Comment