From 723f1495ef90771ea4b620ba152a81f503ca761f Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 1 Jun 2023 11:26:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=91=E5=B8=83=E5=8E=8B?= =?UTF-8?q?=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PublishSite/PublishForm.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/PublishSite/PublishForm.cs b/PublishSite/PublishForm.cs index 72c52afe..e18b0318 100644 --- a/PublishSite/PublishForm.cs +++ b/PublishSite/PublishForm.cs @@ -884,7 +884,7 @@ namespace PublishSite var desTinationFoder = Path.GetDirectoryName(binPath); - sshNetCorePublishBtn.Enabled = false; + var filePath = publishFileTBox.Text; var realName = Path.GetFileName(filePath); @@ -902,11 +902,14 @@ namespace PublishSite return; } + sshNetCorePublishBtn.Enabled = false; + WinformLog($"开始上传后端部署文件{realName}..."); await NetCoreZipPublishAsync(filePath, desTinationFoder); WinformLog($"后端发布结束"); + sshNetCorePublishBtn.Enabled = true; } @@ -994,12 +997,14 @@ namespace PublishSite private async void sshNetCorePublishBtn2_Click(object sender, EventArgs e) { + if (string.IsNullOrEmpty(publishFolderTBox.Text)) { WinformLog($"请选择存在的文件夹才能开始发布", Color.Red); return; } + sshNetCorePublishBtn2.Enabled = false; var binPath = jObjectCofig["DefaultService"]["BinPath"].ToString(); @@ -1007,7 +1012,7 @@ namespace PublishSite var desTinationFoder = Path.GetDirectoryName(binPath); - sshNetCorePublishBtn2.Enabled = false; + WinformLog($"开始打包该文件夹下的内容..."); @@ -1023,9 +1028,8 @@ namespace PublishSite await Task.Run( () => { //将文件夹里的内容打包成压缩包 - ZipFile.CreateFromDirectory(localSourceFolder, filePath); - - + ZipFile.CreateFromDirectory(localSourceFolder, filePath,CompressionLevel.Fastest,true); + }); }