diff --git a/v2rayN/ServiceLib/Handler/WebDavHandler.cs b/v2rayN/ServiceLib/Handler/WebDavHandler.cs
index fd1d5e55..652c43f2 100644
--- a/v2rayN/ServiceLib/Handler/WebDavHandler.cs
+++ b/v2rayN/ServiceLib/Handler/WebDavHandler.cs
@@ -35,6 +35,14 @@ namespace ServiceLib.Handler
_client?.Dispose();
_client = null;
}
+ if (_config.webDavItem.dirName.IsNullOrEmpty())
+ {
+ _webDir = Global.AppName + "_backup";
+ }
+ else
+ {
+ _webDir = _config.webDavItem.dirName.TrimEx();
+ }
var clientParams = new WebDavClientParams
{
@@ -145,6 +153,7 @@ namespace ServiceLib.Handler
if (!response.IsSuccessful)
{
SaveLog(response.Description);
+ return false;
}
using var outputFileStream = new FileStream(fileName, FileMode.Create);
response.Stream.CopyTo(outputFileStream);
diff --git a/v2rayN/ServiceLib/Models/ConfigItems.cs b/v2rayN/ServiceLib/Models/ConfigItems.cs
index ec09ab6f..d29d6c35 100644
--- a/v2rayN/ServiceLib/Models/ConfigItems.cs
+++ b/v2rayN/ServiceLib/Models/ConfigItems.cs
@@ -255,5 +255,6 @@
public string? url { get; set; }
public string? userName { get; set; }
public string? password { get; set; }
+ public string? dirName { get; set; }
}
}
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
index dadb11ed..a7e2a98b 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
+++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
@@ -591,6 +591,15 @@ namespace ServiceLib.Resx {
}
}
+ ///
+ /// 查找类似 Remote folder name (optional) 的本地化字符串。
+ ///
+ public static string LvWebDavDirName {
+ get {
+ return ResourceManager.GetString("LvWebDavDirName", resourceCulture);
+ }
+ }
+
///
/// 查找类似 WebDav Password 的本地化字符串。
///
diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx
index 87971fbc..615ba3c4 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.resx
@@ -1312,4 +1312,7 @@
WebDav Check
+
+ Remote folder name (optional)
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
index d6ae1fc2..cc652cd3 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
@@ -1309,4 +1309,7 @@
WebDav 服务器地址
+
+ 远程文件夹名称(可选)
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
index 571243c9..1da20edc 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
@@ -1189,4 +1189,7 @@
WebDav 服務器地址
+
+ 遠端資料夾名稱(可選)
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/ViewModels/BackupAndRestoreViewModel.cs b/v2rayN/ServiceLib/ViewModels/BackupAndRestoreViewModel.cs
index 1e3d0d07..9fca6a70 100644
--- a/v2rayN/ServiceLib/ViewModels/BackupAndRestoreViewModel.cs
+++ b/v2rayN/ServiceLib/ViewModels/BackupAndRestoreViewModel.cs
@@ -117,6 +117,11 @@ namespace ServiceLib.ViewModels
{
return;
}
+ //exist
+ if (!File.Exists(fileName))
+ {
+ return;
+ }
//backup first
var fileBackup = Utils.GetBackupPath($"backup_{DateTime.Now:yyyyMMddHHmmss}.zip");
diff --git a/v2rayN/v2rayN/Views/BackupAndRestoreView.xaml b/v2rayN/v2rayN/Views/BackupAndRestoreView.xaml
index fc4a0bb6..16b41c44 100644
--- a/v2rayN/v2rayN/Views/BackupAndRestoreView.xaml
+++ b/v2rayN/v2rayN/Views/BackupAndRestoreView.xaml
@@ -130,6 +130,7 @@
+
@@ -184,9 +185,25 @@
VerticalAlignment="Center"
Style="{StaticResource DefTextBox}" />
+
+
+
+