2dust 2 months ago
parent
commit
8505f2db96
  1. 4
      v2rayN/ServiceLib/Common/FileManager.cs
  2. 2
      v2rayN/ServiceLib/ViewModels/BackupAndRestoreViewModel.cs

4
v2rayN/ServiceLib/Common/FileManager.cs

@ -143,6 +143,10 @@ namespace ServiceLib.Common
{ {
continue; continue;
} }
if (file.Extension == file.Name)
{
continue;
}
string targetFilePath = Path.Combine(destinationDir, file.Name); string targetFilePath = Path.Combine(destinationDir, file.Name);
file.CopyTo(targetFilePath); file.CopyTo(targetFilePath);
} }

2
v2rayN/ServiceLib/ViewModels/BackupAndRestoreViewModel.cs

@ -147,7 +147,7 @@ namespace ServiceLib.ViewModels
var configDirZipTemp = Utils.GetTempPath($"v2rayN_{DateTime.Now:yyyyMMddHHmmss}"); var configDirZipTemp = Utils.GetTempPath($"v2rayN_{DateTime.Now:yyyyMMddHHmmss}");
var configDirTemp = Path.Combine(configDirZipTemp, "guiConfigs"); var configDirTemp = Path.Combine(configDirZipTemp, "guiConfigs");
await Task.Run(() => FileManager.CopyDirectory(configDir, configDirTemp, true, "cache.db")); await Task.Run(() => FileManager.CopyDirectory(configDir, configDirTemp, false, "cache.db"));
var ret = await Task.Run(() => FileManager.CreateFromDirectory(configDirZipTemp, fileName)); var ret = await Task.Run(() => FileManager.CreateFromDirectory(configDirZipTemp, fileName));
await Task.Run(() => Directory.Delete(configDirZipTemp, true)); await Task.Run(() => Directory.Delete(configDirZipTemp, true));
return ret; return ret;

Loading…
Cancel
Save