Browse Source

调整path

fly 1 year ago
parent
commit
174fb5eb3f

+ 3 - 3
Interfaces/FileTransfer/FileTransferService.cs

@@ -17,7 +17,7 @@ namespace WingServerCommon.Interfaces.FileTransfer
     {
         private readonly HttpClient _httpClient;
         private readonly UploadFile _uploadFile;
-        private string _folderBase = AppDomain.CurrentDomain.BaseDirectory + "\\FileTransferRecord\\";  
+        private string _folderBase = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "FileTransferRecord");  
         private int _autoSliceSizeForUpload = 0;
         private long _manualDivisionForUpload = 0;
         
@@ -532,7 +532,7 @@ namespace WingServerCommon.Interfaces.FileTransfer
                 {
                     fileName = Guid.NewGuid().ToString("N").ToUpper() + "." + fileExtension;
                 }
-                var recorderFilePath = savePath + "\\" + fileName;
+                var recorderFilePath = Path.Combine(savePath, fileName);
                 if (File.Exists(recorderFilePath))
                 {
                     File.Delete(recorderFilePath);
@@ -648,7 +648,7 @@ namespace WingServerCommon.Interfaces.FileTransfer
             {
                 fileName = Guid.NewGuid().ToString("N").ToUpper() + "." + fileExtension;
             }
-            var recorderFilePath = srcPath + "\\" + fileName;
+            var recorderFilePath = Path.Combine(srcPath, fileName);
             if (File.Exists(recorderFilePath))
             {
                 //存在删除

+ 2 - 1
ResourceManage/ResourceManager.cs

@@ -75,7 +75,8 @@ namespace WingServerCommon.ResourceManage
             foreach (DirectoryInfo NextFolder in dirInfo)
             {
                 var tempName = string.Empty;
-                if (NextFolder.FullName.Contains("\\Resource\\Languge\\"))
+                var combinePath = Path.Combine("Resource","Languge");
+                if (NextFolder.FullName.Contains(combinePath))
                 {
                     tempName = NextFolder.Name;
                 }