-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShared.cs
More file actions
23 lines (20 loc) · 765 Bytes
/
Shared.cs
File metadata and controls
23 lines (20 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System.IO;
using System.Reactive.Linq;
namespace MoSpeedUI;
public class Shared
{
public static Configuration AppConfiguration = new();
public static void CopyFilesRecursively(string sourcePath, string targetPath)
{
//Now Create all of the directories
foreach (string dirPath in Directory.GetDirectories(sourcePath, "*", SearchOption.AllDirectories))
{
Directory.CreateDirectory(dirPath.Replace(sourcePath, targetPath));
}
//Copy all the files & Replaces any files with the same name
foreach (string newPath in Directory.GetFiles(sourcePath, "*.*",SearchOption.AllDirectories))
{
File.Copy(newPath, newPath.Replace(sourcePath, targetPath), true);
}
}
}