From ab547a9cc9ed136e3f081d183e9d837523061fc8 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 30 Jun 2023 08:52:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8F=91=E5=B8=83=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PublishSite/Program.cs | 17 - PublishSite/PublishForm.Designer.cs | 1058 --------------------- PublishSite/PublishForm.cs | 1098 ---------------------- PublishSite/PublishForm.resx | 129 --- PublishSite/PublishSite.csproj | 55 -- PublishSite/appsettings.Development.json | 23 - PublishSite/appsettings.Production.json | 22 - PublishSite/appsettings.USDemo.json | 23 - PublishSite/appsettings.Verify.json | 22 - PublishSite/appsettings.local.json | 21 - PublishSite/icons8-publish-100.ico | Bin 41662 -> 0 bytes 11 files changed, 2468 deletions(-) delete mode 100644 PublishSite/Program.cs delete mode 100644 PublishSite/PublishForm.Designer.cs delete mode 100644 PublishSite/PublishForm.cs delete mode 100644 PublishSite/PublishForm.resx delete mode 100644 PublishSite/PublishSite.csproj delete mode 100644 PublishSite/appsettings.Development.json delete mode 100644 PublishSite/appsettings.Production.json delete mode 100644 PublishSite/appsettings.USDemo.json delete mode 100644 PublishSite/appsettings.Verify.json delete mode 100644 PublishSite/appsettings.local.json delete mode 100644 PublishSite/icons8-publish-100.ico diff --git a/PublishSite/Program.cs b/PublishSite/Program.cs deleted file mode 100644 index 6e1a649d..00000000 --- a/PublishSite/Program.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace PublishSite -{ - internal static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - // To customize application configuration such as set high DPI settings or default font, - // see https://aka.ms/applicationconfiguration. - ApplicationConfiguration.Initialize(); - Application.Run(new PublishForm()); - } - } -} \ No newline at end of file diff --git a/PublishSite/PublishForm.Designer.cs b/PublishSite/PublishForm.Designer.cs deleted file mode 100644 index 18193700..00000000 --- a/PublishSite/PublishForm.Designer.cs +++ /dev/null @@ -1,1058 +0,0 @@ -namespace PublishSite -{ - partial class PublishForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - groupBox1 = new GroupBox(); - rb_USDemo = new RadioButton(); - rb_production = new RadioButton(); - rb_Verify = new RadioButton(); - rb_test = new RadioButton(); - rb_local = new RadioButton(); - groupBox3 = new GroupBox(); - logTBox = new RichTextBox(); - tabControl1 = new TabControl(); - tabPage2 = new TabPage(); - materialLabel3 = new MaterialSkin2DotNet.Controls.MaterialLabel(); - backExePath = new MaterialSkin2DotNet.Controls.MaterialMaskedTextBox(); - backPathTBox = new MaterialSkin2DotNet.Controls.MaterialMaskedTextBox(); - bakConfigSaveBtn = new MaterialSkin2DotNet.Controls.MaterialButton(); - bakDbName = new MaterialSkin2DotNet.Controls.MaterialMaskedTextBox(); - materialLabel1 = new MaterialSkin2DotNet.Controls.MaterialLabel(); - materialLabel2 = new MaterialSkin2DotNet.Controls.MaterialLabel(); - startBakBtn = new MaterialSkin2DotNet.Controls.MaterialButton(); - tabPage5 = new TabPage(); - publishFolderTBox = new MaterialSkin2DotNet.Controls.MaterialMaskedTextBox(); - publishFileTBox = new MaterialSkin2DotNet.Controls.MaterialMaskedTextBox(); - materialLabel4 = new MaterialSkin2DotNet.Controls.MaterialLabel(); - selectPublishFilePathBtn = new MaterialSkin2DotNet.Controls.MaterialButton(); - sshNetCorePublishBtn = new MaterialSkin2DotNet.Controls.MaterialButton(); - sshNetCorePublishBtn2 = new MaterialSkin2DotNet.Controls.MaterialButton(); - sshVuePublishBtn = new MaterialSkin2DotNet.Controls.MaterialButton(); - materialLabel5 = new MaterialSkin2DotNet.Controls.MaterialLabel(); - selectPublishFolderPathBtn = new MaterialSkin2DotNet.Controls.MaterialButton(); - tabPage6 = new TabPage(); - groupBox2 = new GroupBox(); - stopServiceBtn = new MaterialSkin2DotNet.Controls.MaterialButton(); - startServiceBtn = new MaterialSkin2DotNet.Controls.MaterialButton(); - label2 = new Label(); - startOrStopServiceTbox = new TextBox(); - groupBox4 = new GroupBox(); - selectPathBtn = new MaterialSkin2DotNet.Controls.MaterialButton(); - deleteService_Btn = new MaterialSkin2DotNet.Controls.MaterialButton(); - createService_Btn = new MaterialSkin2DotNet.Controls.MaterialButton(); - serviceConfigSaveBtn = new MaterialSkin2DotNet.Controls.MaterialButton(); - servicePortTBox = new TextBox(); - label6 = new Label(); - serviceNameTBox = new TextBox(); - label10 = new Label(); - label11 = new Label(); - serviceDisplayNameTBox = new TextBox(); - en_TBox = new TextBox(); - label9 = new Label(); - label1 = new Label(); - exePathTbox = new TextBox(); - groupBox5 = new GroupBox(); - netCorePublishBtn = new MaterialSkin2DotNet.Controls.MaterialButton(); - vuePublishBtn = new MaterialSkin2DotNet.Controls.MaterialButton(); - openFileDialog1 = new OpenFileDialog(); - openPublishFileDialog = new OpenFileDialog(); - folderBrowserDialog1 = new FolderBrowserDialog(); - groupBox1.SuspendLayout(); - groupBox3.SuspendLayout(); - tabControl1.SuspendLayout(); - tabPage2.SuspendLayout(); - tabPage5.SuspendLayout(); - tabPage6.SuspendLayout(); - groupBox2.SuspendLayout(); - groupBox4.SuspendLayout(); - groupBox5.SuspendLayout(); - SuspendLayout(); - // - // groupBox1 - // - groupBox1.Controls.Add(rb_USDemo); - groupBox1.Controls.Add(rb_production); - groupBox1.Controls.Add(rb_Verify); - groupBox1.Controls.Add(rb_test); - groupBox1.Controls.Add(rb_local); - groupBox1.Font = new Font("Microsoft YaHei UI", 10.5F, FontStyle.Regular, GraphicsUnit.Point); - groupBox1.Location = new Point(12, 189); - groupBox1.Name = "groupBox1"; - groupBox1.Size = new Size(661, 105); - groupBox1.TabIndex = 1; - groupBox1.TabStop = false; - groupBox1.Text = "环境(服务的操作,备份操作作用的主机)"; - // - // rb_USDemo - // - rb_USDemo.AutoSize = true; - rb_USDemo.Location = new Point(555, 48); - rb_USDemo.Name = "rb_USDemo"; - rb_USDemo.Size = new Size(83, 24); - rb_USDemo.TabIndex = 4; - rb_USDemo.Text = "美国演示"; - rb_USDemo.UseVisualStyleBackColor = true; - rb_USDemo.Click += rb_Env_CheckedChanged; - // - // rb_production - // - rb_production.AutoSize = true; - rb_production.Location = new Point(434, 48); - rb_production.Name = "rb_production"; - rb_production.Size = new Size(55, 24); - rb_production.TabIndex = 3; - rb_production.Text = "正式"; - rb_production.UseVisualStyleBackColor = true; - rb_production.Click += rb_Env_CheckedChanged; - // - // rb_Verify - // - rb_Verify.AutoSize = true; - rb_Verify.Location = new Point(300, 48); - rb_Verify.Name = "rb_Verify"; - rb_Verify.Size = new Size(55, 24); - rb_Verify.TabIndex = 2; - rb_Verify.Text = "验证"; - rb_Verify.UseVisualStyleBackColor = true; - rb_Verify.Click += rb_Env_CheckedChanged; - // - // rb_test - // - rb_test.AutoSize = true; - rb_test.Location = new Point(164, 48); - rb_test.Name = "rb_test"; - rb_test.Size = new Size(55, 24); - rb_test.TabIndex = 1; - rb_test.Text = "测试"; - rb_test.UseVisualStyleBackColor = true; - rb_test.Click += rb_Env_CheckedChanged; - // - // rb_local - // - rb_local.AutoSize = true; - rb_local.Checked = true; - rb_local.Location = new Point(24, 48); - rb_local.Name = "rb_local"; - rb_local.Size = new Size(55, 24); - rb_local.TabIndex = 0; - rb_local.TabStop = true; - rb_local.Text = "本机"; - rb_local.UseVisualStyleBackColor = true; - rb_local.Click += rb_Env_CheckedChanged; - // - // groupBox3 - // - groupBox3.Controls.Add(logTBox); - groupBox3.Font = new Font("Microsoft YaHei UI", 10.5F, FontStyle.Regular, GraphicsUnit.Point); - groupBox3.Location = new Point(681, 70); - groupBox3.Name = "groupBox3"; - groupBox3.Size = new Size(497, 947); - groupBox3.TabIndex = 3; - groupBox3.TabStop = false; - groupBox3.Text = "日志"; - // - // logTBox - // - logTBox.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point); - logTBox.Location = new Point(9, 20); - logTBox.Name = "logTBox"; - logTBox.Size = new Size(469, 920); - logTBox.TabIndex = 1; - logTBox.Text = ""; - // - // tabControl1 - // - tabControl1.Controls.Add(tabPage2); - tabControl1.Controls.Add(tabPage5); - tabControl1.Controls.Add(tabPage6); - tabControl1.Font = new Font("Microsoft YaHei UI", 10.5F, FontStyle.Regular, GraphicsUnit.Point); - tabControl1.Location = new Point(12, 310); - tabControl1.Name = "tabControl1"; - tabControl1.SelectedIndex = 0; - tabControl1.Size = new Size(672, 689); - tabControl1.TabIndex = 2; - // - // tabPage2 - // - tabPage2.BackColor = Color.White; - tabPage2.Controls.Add(materialLabel3); - tabPage2.Controls.Add(backExePath); - tabPage2.Controls.Add(backPathTBox); - tabPage2.Controls.Add(bakConfigSaveBtn); - tabPage2.Controls.Add(bakDbName); - tabPage2.Controls.Add(materialLabel1); - tabPage2.Controls.Add(materialLabel2); - tabPage2.Controls.Add(startBakBtn); - tabPage2.Location = new Point(4, 29); - tabPage2.Name = "tabPage2"; - tabPage2.Padding = new Padding(3); - tabPage2.Size = new Size(664, 656); - tabPage2.TabIndex = 0; - tabPage2.Text = "备份远程网站"; - // - // materialLabel3 - // - materialLabel3.AutoSize = true; - materialLabel3.Depth = 0; - materialLabel3.Font = new Font("Roboto", 14F, FontStyle.Regular, GraphicsUnit.Pixel); - materialLabel3.Location = new Point(30, 290); - materialLabel3.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - materialLabel3.Name = "materialLabel3"; - materialLabel3.Size = new Size(225, 19); - materialLabel3.TabIndex = 4; - materialLabel3.Text = "后端数据库和程序备份根路径:"; - // - // backExePath - // - backExePath.AllowPromptAsInput = true; - backExePath.AnimateReadOnly = false; - backExePath.AsciiOnly = false; - backExePath.BackgroundImageLayout = ImageLayout.None; - backExePath.BeepOnError = false; - backExePath.CutCopyMaskFormat = MaskFormat.IncludeLiterals; - backExePath.Depth = 0; - backExePath.Font = new Font("Microsoft Sans Serif", 9F, FontStyle.Regular, GraphicsUnit.Point); - backExePath.HidePromptOnLeave = false; - backExePath.HideSelection = true; - backExePath.InsertKeyMode = InsertKeyMode.Default; - backExePath.LeadingIcon = null; - backExePath.Location = new Point(30, 210); - backExePath.Mask = ""; - backExePath.MaxLength = 32767; - backExePath.MouseState = MaterialSkin2DotNet.MouseState.OUT; - backExePath.Name = "backExePath"; - backExePath.PasswordChar = '\0'; - backExePath.PrefixSuffixText = null; - backExePath.PromptChar = '_'; - backExePath.ReadOnly = false; - backExePath.RejectInputOnFirstFailure = false; - backExePath.ResetOnPrompt = true; - backExePath.ResetOnSpace = true; - backExePath.RightToLeft = RightToLeft.No; - backExePath.SelectedText = ""; - backExePath.SelectionLength = 0; - backExePath.SelectionStart = 0; - backExePath.ShortcutsEnabled = true; - backExePath.Size = new Size(583, 48); - backExePath.SkipLiterals = true; - backExePath.TabIndex = 3; - backExePath.TabStop = false; - backExePath.TextAlign = HorizontalAlignment.Left; - backExePath.TextMaskFormat = MaskFormat.IncludeLiterals; - backExePath.TrailingIcon = null; - backExePath.UseSystemPasswordChar = false; - backExePath.ValidatingType = null; - // - // backPathTBox - // - backPathTBox.AllowPromptAsInput = true; - backPathTBox.AnimateReadOnly = false; - backPathTBox.AsciiOnly = false; - backPathTBox.BackgroundImageLayout = ImageLayout.None; - backPathTBox.BeepOnError = false; - backPathTBox.CutCopyMaskFormat = MaskFormat.IncludeLiterals; - backPathTBox.Depth = 0; - backPathTBox.Font = new Font("Microsoft Sans Serif", 9F, FontStyle.Regular, GraphicsUnit.Point); - backPathTBox.HidePromptOnLeave = false; - backPathTBox.HideSelection = true; - backPathTBox.InsertKeyMode = InsertKeyMode.Default; - backPathTBox.LeadingIcon = null; - backPathTBox.Location = new Point(30, 341); - backPathTBox.Mask = ""; - backPathTBox.MaxLength = 32767; - backPathTBox.MouseState = MaterialSkin2DotNet.MouseState.OUT; - backPathTBox.Name = "backPathTBox"; - backPathTBox.PasswordChar = '\0'; - backPathTBox.PrefixSuffixText = null; - backPathTBox.PromptChar = '_'; - backPathTBox.ReadOnly = false; - backPathTBox.RejectInputOnFirstFailure = false; - backPathTBox.ResetOnPrompt = true; - backPathTBox.ResetOnSpace = true; - backPathTBox.RightToLeft = RightToLeft.No; - backPathTBox.SelectedText = ""; - backPathTBox.SelectionLength = 0; - backPathTBox.SelectionStart = 0; - backPathTBox.ShortcutsEnabled = true; - backPathTBox.Size = new Size(583, 48); - backPathTBox.SkipLiterals = true; - backPathTBox.TabIndex = 4; - backPathTBox.TabStop = false; - backPathTBox.TextAlign = HorizontalAlignment.Left; - backPathTBox.TextMaskFormat = MaskFormat.IncludeLiterals; - backPathTBox.TrailingIcon = null; - backPathTBox.UseSystemPasswordChar = false; - backPathTBox.ValidatingType = null; - // - // bakConfigSaveBtn - // - bakConfigSaveBtn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - bakConfigSaveBtn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - bakConfigSaveBtn.Depth = 0; - bakConfigSaveBtn.HighEmphasis = true; - bakConfigSaveBtn.Icon = null; - bakConfigSaveBtn.Location = new Point(120, 504); - bakConfigSaveBtn.Margin = new Padding(4, 6, 4, 6); - bakConfigSaveBtn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - bakConfigSaveBtn.Name = "bakConfigSaveBtn"; - bakConfigSaveBtn.NoAccentTextColor = Color.Empty; - bakConfigSaveBtn.Size = new Size(117, 36); - bakConfigSaveBtn.TabIndex = 43; - bakConfigSaveBtn.Text = "备份配置保存"; - bakConfigSaveBtn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - bakConfigSaveBtn.UseAccentColor = false; - bakConfigSaveBtn.UseVisualStyleBackColor = true; - bakConfigSaveBtn.Click += bakConfigSaveBtn_Click; - // - // bakDbName - // - bakDbName.AllowPromptAsInput = true; - bakDbName.AnimateReadOnly = false; - bakDbName.AsciiOnly = false; - bakDbName.BackgroundImageLayout = ImageLayout.None; - bakDbName.BeepOnError = false; - bakDbName.CutCopyMaskFormat = MaskFormat.IncludeLiterals; - bakDbName.Depth = 0; - bakDbName.Font = new Font("Microsoft Sans Serif", 9F, FontStyle.Regular, GraphicsUnit.Point); - bakDbName.HidePromptOnLeave = false; - bakDbName.HideSelection = true; - bakDbName.InsertKeyMode = InsertKeyMode.Default; - bakDbName.LeadingIcon = null; - bakDbName.Location = new Point(30, 79); - bakDbName.Mask = ""; - bakDbName.MaxLength = 32767; - bakDbName.MouseState = MaterialSkin2DotNet.MouseState.OUT; - bakDbName.Name = "bakDbName"; - bakDbName.PasswordChar = '\0'; - bakDbName.PrefixSuffixText = null; - bakDbName.PromptChar = '_'; - bakDbName.ReadOnly = false; - bakDbName.RejectInputOnFirstFailure = false; - bakDbName.ResetOnPrompt = true; - bakDbName.ResetOnSpace = true; - bakDbName.RightToLeft = RightToLeft.No; - bakDbName.SelectedText = ""; - bakDbName.SelectionLength = 0; - bakDbName.SelectionStart = 0; - bakDbName.ShortcutsEnabled = true; - bakDbName.Size = new Size(583, 48); - bakDbName.SkipLiterals = true; - bakDbName.TabIndex = 2; - bakDbName.TabStop = false; - bakDbName.TextAlign = HorizontalAlignment.Left; - bakDbName.TextMaskFormat = MaskFormat.IncludeLiterals; - bakDbName.TrailingIcon = null; - bakDbName.UseSystemPasswordChar = false; - bakDbName.ValidatingType = null; - // - // materialLabel1 - // - materialLabel1.AutoSize = true; - materialLabel1.Depth = 0; - materialLabel1.Font = new Font("Roboto", 14F, FontStyle.Regular, GraphicsUnit.Pixel); - materialLabel1.Location = new Point(30, 28); - materialLabel1.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - materialLabel1.Name = "materialLabel1"; - materialLabel1.Size = new Size(129, 19); - materialLabel1.TabIndex = 2; - materialLabel1.Text = "被备份数据库名:"; - // - // materialLabel2 - // - materialLabel2.AutoSize = true; - materialLabel2.Depth = 0; - materialLabel2.Font = new Font("Roboto", 14F, FontStyle.Regular, GraphicsUnit.Pixel); - materialLabel2.Location = new Point(30, 159); - materialLabel2.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - materialLabel2.Name = "materialLabel2"; - materialLabel2.Size = new Size(129, 19); - materialLabel2.TabIndex = 3; - materialLabel2.Text = "被备份程序路径:"; - // - // startBakBtn - // - startBakBtn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - startBakBtn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - startBakBtn.Depth = 0; - startBakBtn.HighEmphasis = true; - startBakBtn.Icon = null; - startBakBtn.Location = new Point(405, 504); - startBakBtn.Margin = new Padding(4, 6, 4, 6); - startBakBtn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - startBakBtn.Name = "startBakBtn"; - startBakBtn.NoAccentTextColor = Color.Empty; - startBakBtn.Size = new Size(85, 36); - startBakBtn.TabIndex = 44; - startBakBtn.Text = "开始备份"; - startBakBtn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - startBakBtn.UseAccentColor = false; - startBakBtn.UseVisualStyleBackColor = true; - startBakBtn.Click += startBakBtn_Click; - // - // tabPage5 - // - tabPage5.BackColor = Color.White; - tabPage5.Controls.Add(publishFolderTBox); - tabPage5.Controls.Add(publishFileTBox); - tabPage5.Controls.Add(materialLabel4); - tabPage5.Controls.Add(selectPublishFilePathBtn); - tabPage5.Controls.Add(sshNetCorePublishBtn); - tabPage5.Controls.Add(sshNetCorePublishBtn2); - tabPage5.Controls.Add(sshVuePublishBtn); - tabPage5.Controls.Add(materialLabel5); - tabPage5.Controls.Add(selectPublishFolderPathBtn); - tabPage5.Location = new Point(4, 29); - tabPage5.Name = "tabPage5"; - tabPage5.Padding = new Padding(3); - tabPage5.Size = new Size(664, 656); - tabPage5.TabIndex = 1; - tabPage5.Text = "发布远程网站"; - // - // publishFolderTBox - // - publishFolderTBox.AllowPromptAsInput = true; - publishFolderTBox.AnimateReadOnly = false; - publishFolderTBox.AsciiOnly = false; - publishFolderTBox.BackgroundImageLayout = ImageLayout.None; - publishFolderTBox.BeepOnError = false; - publishFolderTBox.CutCopyMaskFormat = MaskFormat.IncludeLiterals; - publishFolderTBox.Depth = 0; - publishFolderTBox.Font = new Font("Microsoft Sans Serif", 9F, FontStyle.Regular, GraphicsUnit.Point); - publishFolderTBox.HidePromptOnLeave = false; - publishFolderTBox.HideSelection = true; - publishFolderTBox.InsertKeyMode = InsertKeyMode.Default; - publishFolderTBox.LeadingIcon = null; - publishFolderTBox.Location = new Point(20, 448); - publishFolderTBox.Mask = ""; - publishFolderTBox.MaxLength = 32767; - publishFolderTBox.MouseState = MaterialSkin2DotNet.MouseState.OUT; - publishFolderTBox.Name = "publishFolderTBox"; - publishFolderTBox.PasswordChar = '\0'; - publishFolderTBox.PrefixSuffixText = null; - publishFolderTBox.PromptChar = '_'; - publishFolderTBox.ReadOnly = false; - publishFolderTBox.RejectInputOnFirstFailure = false; - publishFolderTBox.ResetOnPrompt = true; - publishFolderTBox.ResetOnSpace = true; - publishFolderTBox.RightToLeft = RightToLeft.No; - publishFolderTBox.SelectedText = ""; - publishFolderTBox.SelectionLength = 0; - publishFolderTBox.SelectionStart = 0; - publishFolderTBox.ShortcutsEnabled = true; - publishFolderTBox.Size = new Size(483, 48); - publishFolderTBox.SkipLiterals = true; - publishFolderTBox.TabIndex = 60; - publishFolderTBox.TabStop = false; - publishFolderTBox.TextAlign = HorizontalAlignment.Left; - publishFolderTBox.TextMaskFormat = MaskFormat.IncludeLiterals; - publishFolderTBox.TrailingIcon = null; - publishFolderTBox.UseSystemPasswordChar = false; - publishFolderTBox.ValidatingType = null; - // - // publishFileTBox - // - publishFileTBox.AllowPromptAsInput = true; - publishFileTBox.AnimateReadOnly = false; - publishFileTBox.AsciiOnly = false; - publishFileTBox.BackgroundImageLayout = ImageLayout.None; - publishFileTBox.BeepOnError = false; - publishFileTBox.CutCopyMaskFormat = MaskFormat.IncludeLiterals; - publishFileTBox.Depth = 0; - publishFileTBox.Font = new Font("Microsoft Sans Serif", 9F, FontStyle.Regular, GraphicsUnit.Point); - publishFileTBox.HidePromptOnLeave = false; - publishFileTBox.HideSelection = true; - publishFileTBox.InsertKeyMode = InsertKeyMode.Default; - publishFileTBox.LeadingIcon = null; - publishFileTBox.Location = new Point(20, 76); - publishFileTBox.Mask = ""; - publishFileTBox.MaxLength = 32767; - publishFileTBox.MouseState = MaterialSkin2DotNet.MouseState.OUT; - publishFileTBox.Name = "publishFileTBox"; - publishFileTBox.PasswordChar = '\0'; - publishFileTBox.PrefixSuffixText = null; - publishFileTBox.PromptChar = '_'; - publishFileTBox.ReadOnly = false; - publishFileTBox.RejectInputOnFirstFailure = false; - publishFileTBox.ResetOnPrompt = true; - publishFileTBox.ResetOnSpace = true; - publishFileTBox.RightToLeft = RightToLeft.No; - publishFileTBox.SelectedText = ""; - publishFileTBox.SelectionLength = 0; - publishFileTBox.SelectionStart = 0; - publishFileTBox.ShortcutsEnabled = true; - publishFileTBox.Size = new Size(483, 48); - publishFileTBox.SkipLiterals = true; - publishFileTBox.TabIndex = 59; - publishFileTBox.TabStop = false; - publishFileTBox.TextAlign = HorizontalAlignment.Left; - publishFileTBox.TextMaskFormat = MaskFormat.IncludeLiterals; - publishFileTBox.TrailingIcon = null; - publishFileTBox.UseSystemPasswordChar = false; - publishFileTBox.ValidatingType = null; - // - // materialLabel4 - // - materialLabel4.AutoSize = true; - materialLabel4.Depth = 0; - materialLabel4.Font = new Font("Roboto", 14F, FontStyle.Regular, GraphicsUnit.Pixel); - materialLabel4.Location = new Point(20, 30); - materialLabel4.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - materialLabel4.Name = "materialLabel4"; - materialLabel4.Size = new Size(473, 19); - materialLabel4.TabIndex = 57; - materialLabel4.Text = "方式一: 前端发布选择html | 后端发布选择压缩包 (上传后发布)"; - // - // selectPublishFilePathBtn - // - selectPublishFilePathBtn.AutoSize = false; - selectPublishFilePathBtn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - selectPublishFilePathBtn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - selectPublishFilePathBtn.Depth = 0; - selectPublishFilePathBtn.HighEmphasis = true; - selectPublishFilePathBtn.Icon = null; - selectPublishFilePathBtn.Location = new Point(523, 85); - selectPublishFilePathBtn.Margin = new Padding(4, 6, 4, 6); - selectPublishFilePathBtn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - selectPublishFilePathBtn.Name = "selectPublishFilePathBtn"; - selectPublishFilePathBtn.NoAccentTextColor = Color.Empty; - selectPublishFilePathBtn.Size = new Size(85, 30); - selectPublishFilePathBtn.TabIndex = 43; - selectPublishFilePathBtn.Text = "选择"; - selectPublishFilePathBtn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - selectPublishFilePathBtn.UseAccentColor = false; - selectPublishFilePathBtn.UseVisualStyleBackColor = true; - selectPublishFilePathBtn.Click += selectPublishFilePathBtn_Click; - // - // sshNetCorePublishBtn - // - sshNetCorePublishBtn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - sshNetCorePublishBtn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - sshNetCorePublishBtn.Depth = 0; - sshNetCorePublishBtn.HighEmphasis = true; - sshNetCorePublishBtn.Icon = null; - sshNetCorePublishBtn.Location = new Point(389, 174); - sshNetCorePublishBtn.Margin = new Padding(4, 6, 4, 6); - sshNetCorePublishBtn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - sshNetCorePublishBtn.Name = "sshNetCorePublishBtn"; - sshNetCorePublishBtn.NoAccentTextColor = Color.Empty; - sshNetCorePublishBtn.Size = new Size(85, 36); - sshNetCorePublishBtn.TabIndex = 54; - sshNetCorePublishBtn.Text = "发布后端"; - sshNetCorePublishBtn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - sshNetCorePublishBtn.UseAccentColor = false; - sshNetCorePublishBtn.UseVisualStyleBackColor = true; - sshNetCorePublishBtn.Click += sshNetCorePublishBtn_Click; - // - // sshNetCorePublishBtn2 - // - sshNetCorePublishBtn2.AutoSizeMode = AutoSizeMode.GrowAndShrink; - sshNetCorePublishBtn2.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - sshNetCorePublishBtn2.Depth = 0; - sshNetCorePublishBtn2.HighEmphasis = true; - sshNetCorePublishBtn2.Icon = null; - sshNetCorePublishBtn2.Location = new Point(389, 543); - sshNetCorePublishBtn2.Margin = new Padding(4, 6, 4, 6); - sshNetCorePublishBtn2.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - sshNetCorePublishBtn2.Name = "sshNetCorePublishBtn2"; - sshNetCorePublishBtn2.NoAccentTextColor = Color.Empty; - sshNetCorePublishBtn2.Size = new Size(85, 36); - sshNetCorePublishBtn2.TabIndex = 55; - sshNetCorePublishBtn2.Text = "发布后端"; - sshNetCorePublishBtn2.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - sshNetCorePublishBtn2.UseAccentColor = false; - sshNetCorePublishBtn2.UseVisualStyleBackColor = true; - sshNetCorePublishBtn2.Click += sshNetCorePublishBtn2_Click; - // - // sshVuePublishBtn - // - sshVuePublishBtn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - sshVuePublishBtn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - sshVuePublishBtn.Depth = 0; - sshVuePublishBtn.HighEmphasis = true; - sshVuePublishBtn.Icon = null; - sshVuePublishBtn.Location = new Point(136, 174); - sshVuePublishBtn.Margin = new Padding(4, 6, 4, 6); - sshVuePublishBtn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - sshVuePublishBtn.Name = "sshVuePublishBtn"; - sshVuePublishBtn.NoAccentTextColor = Color.Empty; - sshVuePublishBtn.Size = new Size(85, 36); - sshVuePublishBtn.TabIndex = 53; - sshVuePublishBtn.Text = "发布前端"; - sshVuePublishBtn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - sshVuePublishBtn.UseAccentColor = false; - sshVuePublishBtn.UseVisualStyleBackColor = true; - sshVuePublishBtn.Click += sshVuePublishBtn_Click; - // - // materialLabel5 - // - materialLabel5.AutoSize = true; - materialLabel5.Depth = 0; - materialLabel5.Font = new Font("Roboto", 14F, FontStyle.Regular, GraphicsUnit.Pixel); - materialLabel5.Location = new Point(20, 401); - materialLabel5.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - materialLabel5.Name = "materialLabel5"; - materialLabel5.Size = new Size(501, 19); - materialLabel5.TabIndex = 58; - materialLabel5.Text = "方式二: 后端发布程序文件夹(程序自动打成压缩包,上传然后发布)"; - // - // selectPublishFolderPathBtn - // - selectPublishFolderPathBtn.AutoSize = false; - selectPublishFolderPathBtn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - selectPublishFolderPathBtn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - selectPublishFolderPathBtn.Depth = 0; - selectPublishFolderPathBtn.HighEmphasis = true; - selectPublishFolderPathBtn.Icon = null; - selectPublishFolderPathBtn.Location = new Point(523, 457); - selectPublishFolderPathBtn.Margin = new Padding(4, 6, 4, 6); - selectPublishFolderPathBtn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - selectPublishFolderPathBtn.Name = "selectPublishFolderPathBtn"; - selectPublishFolderPathBtn.NoAccentTextColor = Color.Empty; - selectPublishFolderPathBtn.Size = new Size(85, 30); - selectPublishFolderPathBtn.TabIndex = 56; - selectPublishFolderPathBtn.Text = "选择"; - selectPublishFolderPathBtn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - selectPublishFolderPathBtn.UseAccentColor = false; - selectPublishFolderPathBtn.UseVisualStyleBackColor = true; - selectPublishFolderPathBtn.Click += selectPublishFolderPathBtn_Click; - // - // tabPage6 - // - tabPage6.BackColor = Color.White; - tabPage6.Controls.Add(groupBox2); - tabPage6.Controls.Add(groupBox4); - tabPage6.Location = new Point(4, 29); - tabPage6.Name = "tabPage6"; - tabPage6.Padding = new Padding(3); - tabPage6.Size = new Size(664, 656); - tabPage6.TabIndex = 2; - tabPage6.Text = "服务相关操作"; - // - // groupBox2 - // - groupBox2.Controls.Add(stopServiceBtn); - groupBox2.Controls.Add(startServiceBtn); - groupBox2.Controls.Add(label2); - groupBox2.Controls.Add(startOrStopServiceTbox); - groupBox2.Location = new Point(10, 451); - groupBox2.Name = "groupBox2"; - groupBox2.Size = new Size(645, 189); - groupBox2.TabIndex = 39; - groupBox2.TabStop = false; - groupBox2.Text = "服务停止与启动"; - // - // stopServiceBtn - // - stopServiceBtn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - stopServiceBtn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - stopServiceBtn.Depth = 0; - stopServiceBtn.HighEmphasis = true; - stopServiceBtn.Icon = null; - stopServiceBtn.Location = new Point(379, 119); - stopServiceBtn.Margin = new Padding(4, 6, 4, 6); - stopServiceBtn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - stopServiceBtn.Name = "stopServiceBtn"; - stopServiceBtn.NoAccentTextColor = Color.Empty; - stopServiceBtn.Size = new Size(85, 36); - stopServiceBtn.TabIndex = 44; - stopServiceBtn.Text = "停止服务"; - stopServiceBtn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - stopServiceBtn.UseAccentColor = false; - stopServiceBtn.UseVisualStyleBackColor = true; - stopServiceBtn.Click += stopServiceBtn_Click; - // - // startServiceBtn - // - startServiceBtn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - startServiceBtn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - startServiceBtn.Depth = 0; - startServiceBtn.HighEmphasis = true; - startServiceBtn.Icon = null; - startServiceBtn.Location = new Point(126, 119); - startServiceBtn.Margin = new Padding(4, 6, 4, 6); - startServiceBtn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - startServiceBtn.Name = "startServiceBtn"; - startServiceBtn.NoAccentTextColor = Color.Empty; - startServiceBtn.Size = new Size(85, 36); - startServiceBtn.TabIndex = 43; - startServiceBtn.Text = "启动服务"; - startServiceBtn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - startServiceBtn.UseAccentColor = false; - startServiceBtn.UseVisualStyleBackColor = true; - startServiceBtn.Click += startServiceBtn_Click; - // - // label2 - // - label2.AutoSize = true; - label2.Location = new Point(60, 57); - label2.Name = "label2"; - label2.Size = new Size(65, 20); - label2.TabIndex = 32; - label2.Text = "服务名称"; - // - // startOrStopServiceTbox - // - startOrStopServiceTbox.Location = new Point(141, 54); - startOrStopServiceTbox.Name = "startOrStopServiceTbox"; - startOrStopServiceTbox.Size = new Size(366, 25); - startOrStopServiceTbox.TabIndex = 31; - // - // groupBox4 - // - groupBox4.Controls.Add(selectPathBtn); - groupBox4.Controls.Add(deleteService_Btn); - groupBox4.Controls.Add(createService_Btn); - groupBox4.Controls.Add(serviceConfigSaveBtn); - groupBox4.Controls.Add(servicePortTBox); - groupBox4.Controls.Add(label6); - groupBox4.Controls.Add(serviceNameTBox); - groupBox4.Controls.Add(label10); - groupBox4.Controls.Add(label11); - groupBox4.Controls.Add(serviceDisplayNameTBox); - groupBox4.Controls.Add(en_TBox); - groupBox4.Controls.Add(label9); - groupBox4.Controls.Add(label1); - groupBox4.Controls.Add(exePathTbox); - groupBox4.Location = new Point(6, 6); - groupBox4.Name = "groupBox4"; - groupBox4.Size = new Size(645, 414); - groupBox4.TabIndex = 40; - groupBox4.TabStop = false; - groupBox4.Text = "服务创建与删除"; - // - // selectPathBtn - // - selectPathBtn.AutoSize = false; - selectPathBtn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - selectPathBtn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - selectPathBtn.Depth = 0; - selectPathBtn.HighEmphasis = true; - selectPathBtn.Icon = null; - selectPathBtn.Location = new Point(533, 166); - selectPathBtn.Margin = new Padding(4, 6, 4, 6); - selectPathBtn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - selectPathBtn.Name = "selectPathBtn"; - selectPathBtn.NoAccentTextColor = Color.Empty; - selectPathBtn.Size = new Size(85, 30); - selectPathBtn.TabIndex = 46; - selectPathBtn.Text = "选择"; - selectPathBtn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - selectPathBtn.UseAccentColor = false; - selectPathBtn.UseVisualStyleBackColor = true; - selectPathBtn.Click += selectPathBtn_Click; - // - // deleteService_Btn - // - deleteService_Btn.AutoSize = false; - deleteService_Btn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - deleteService_Btn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - deleteService_Btn.Depth = 0; - deleteService_Btn.HighEmphasis = true; - deleteService_Btn.Icon = null; - deleteService_Btn.Location = new Point(533, 48); - deleteService_Btn.Margin = new Padding(4, 6, 4, 6); - deleteService_Btn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - deleteService_Btn.Name = "deleteService_Btn"; - deleteService_Btn.NoAccentTextColor = Color.Empty; - deleteService_Btn.Size = new Size(85, 30); - deleteService_Btn.TabIndex = 45; - deleteService_Btn.Text = "删除服务"; - deleteService_Btn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - deleteService_Btn.UseAccentColor = false; - deleteService_Btn.UseVisualStyleBackColor = true; - deleteService_Btn.Click += deleteService_Btn_Click; - // - // createService_Btn - // - createService_Btn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - createService_Btn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - createService_Btn.Depth = 0; - createService_Btn.HighEmphasis = true; - createService_Btn.Icon = null; - createService_Btn.Location = new Point(379, 335); - createService_Btn.Margin = new Padding(4, 6, 4, 6); - createService_Btn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - createService_Btn.Name = "createService_Btn"; - createService_Btn.NoAccentTextColor = Color.Empty; - createService_Btn.Size = new Size(85, 36); - createService_Btn.TabIndex = 44; - createService_Btn.Text = "创建服务"; - createService_Btn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - createService_Btn.UseAccentColor = false; - createService_Btn.UseVisualStyleBackColor = true; - createService_Btn.Click += createService_Btn_Click; - // - // serviceConfigSaveBtn - // - serviceConfigSaveBtn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - serviceConfigSaveBtn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - serviceConfigSaveBtn.Depth = 0; - serviceConfigSaveBtn.HighEmphasis = true; - serviceConfigSaveBtn.Icon = null; - serviceConfigSaveBtn.Location = new Point(94, 335); - serviceConfigSaveBtn.Margin = new Padding(4, 6, 4, 6); - serviceConfigSaveBtn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - serviceConfigSaveBtn.Name = "serviceConfigSaveBtn"; - serviceConfigSaveBtn.NoAccentTextColor = Color.Empty; - serviceConfigSaveBtn.Size = new Size(117, 36); - serviceConfigSaveBtn.TabIndex = 43; - serviceConfigSaveBtn.Text = "服务配置保存"; - serviceConfigSaveBtn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - serviceConfigSaveBtn.UseAccentColor = false; - serviceConfigSaveBtn.UseVisualStyleBackColor = true; - serviceConfigSaveBtn.Click += serviceConfigSaveBtn_Click; - // - // servicePortTBox - // - servicePortTBox.Location = new Point(160, 220); - servicePortTBox.Name = "servicePortTBox"; - servicePortTBox.Size = new Size(353, 25); - servicePortTBox.TabIndex = 40; - // - // label6 - // - label6.AutoSize = true; - label6.Location = new Point(58, 226); - label6.Name = "label6"; - label6.Size = new Size(93, 20); - label6.TabIndex = 39; - label6.Text = "服务启动端口"; - // - // serviceNameTBox - // - serviceNameTBox.Location = new Point(159, 52); - serviceNameTBox.Name = "serviceNameTBox"; - serviceNameTBox.Size = new Size(353, 25); - serviceNameTBox.TabIndex = 30; - // - // label10 - // - label10.AutoSize = true; - label10.Location = new Point(30, 55); - label10.Name = "label10"; - label10.Size = new Size(121, 20); - label10.TabIndex = 28; - label10.Text = "网站后端服务名称"; - // - // label11 - // - label11.AutoSize = true; - label11.Location = new Point(4, 114); - label11.Name = "label11"; - label11.Size = new Size(149, 20); - label11.TabIndex = 29; - label11.Text = "网站后端服务显示名称"; - // - // serviceDisplayNameTBox - // - serviceDisplayNameTBox.Location = new Point(160, 111); - serviceDisplayNameTBox.Name = "serviceDisplayNameTBox"; - serviceDisplayNameTBox.Size = new Size(353, 25); - serviceDisplayNameTBox.TabIndex = 31; - // - // en_TBox - // - en_TBox.Location = new Point(159, 274); - en_TBox.Name = "en_TBox"; - en_TBox.Size = new Size(353, 25); - en_TBox.TabIndex = 36; - // - // label9 - // - label9.AutoSize = true; - label9.Location = new Point(58, 172); - label9.Name = "label9"; - label9.Size = new Size(93, 20); - label9.TabIndex = 32; - label9.Text = "程序完整路径"; - // - // label1 - // - label1.AutoSize = true; - label1.Location = new Point(46, 280); - label1.Name = "label1"; - label1.Size = new Size(107, 20); - label1.TabIndex = 35; - label1.Text = "服务定义环境名"; - // - // exePathTbox - // - exePathTbox.Location = new Point(160, 168); - exePathTbox.Name = "exePathTbox"; - exePathTbox.Size = new Size(353, 25); - exePathTbox.TabIndex = 33; - // - // groupBox5 - // - groupBox5.Controls.Add(netCorePublishBtn); - groupBox5.Controls.Add(vuePublishBtn); - groupBox5.Font = new Font("Microsoft YaHei UI", 10.5F, FontStyle.Regular, GraphicsUnit.Point); - groupBox5.Location = new Point(10, 70); - groupBox5.Name = "groupBox5"; - groupBox5.Size = new Size(663, 108); - groupBox5.TabIndex = 41; - groupBox5.TabStop = false; - groupBox5.Text = "测试环境基于备份代码重新发布(感觉自动发布未发布成功,重新发布一下)"; - // - // netCorePublishBtn - // - netCorePublishBtn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - netCorePublishBtn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - netCorePublishBtn.Depth = 0; - netCorePublishBtn.HighEmphasis = true; - netCorePublishBtn.Icon = null; - netCorePublishBtn.Location = new Point(395, 49); - netCorePublishBtn.Margin = new Padding(4, 6, 4, 6); - netCorePublishBtn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - netCorePublishBtn.Name = "netCorePublishBtn"; - netCorePublishBtn.NoAccentTextColor = Color.Empty; - netCorePublishBtn.Size = new Size(85, 36); - netCorePublishBtn.TabIndex = 42; - netCorePublishBtn.Text = "后端发布"; - netCorePublishBtn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - netCorePublishBtn.UseAccentColor = false; - netCorePublishBtn.UseVisualStyleBackColor = true; - netCorePublishBtn.Click += netCorePublishBtn_Click; - // - // vuePublishBtn - // - vuePublishBtn.AutoSizeMode = AutoSizeMode.GrowAndShrink; - vuePublishBtn.Density = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonDensity.Dense; - vuePublishBtn.Depth = 0; - vuePublishBtn.HighEmphasis = true; - vuePublishBtn.Icon = null; - vuePublishBtn.Location = new Point(142, 49); - vuePublishBtn.Margin = new Padding(4, 6, 4, 6); - vuePublishBtn.MouseState = MaterialSkin2DotNet.MouseState.HOVER; - vuePublishBtn.Name = "vuePublishBtn"; - vuePublishBtn.NoAccentTextColor = Color.Empty; - vuePublishBtn.Size = new Size(85, 36); - vuePublishBtn.TabIndex = 41; - vuePublishBtn.Text = "前端发布"; - vuePublishBtn.Type = MaterialSkin2DotNet.Controls.MaterialButton.MaterialButtonType.Contained; - vuePublishBtn.UseAccentColor = false; - vuePublishBtn.UseVisualStyleBackColor = true; - vuePublishBtn.Click += vuePublishBtn_Click; - // - // openFileDialog1 - // - openFileDialog1.FileName = "openFileDialog1"; - // - // openPublishFileDialog - // - openPublishFileDialog.FileName = "openFileDialog2"; - // - // PublishForm - // - AutoScaleDimensions = new SizeF(7F, 17F); - AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1198, 1023); - Controls.Add(tabControl1); - Controls.Add(groupBox5); - Controls.Add(groupBox3); - Controls.Add(groupBox1); - Name = "PublishForm"; - Text = "IRaCIS One click Publish"; - Load += PublishForm_Load; - groupBox1.ResumeLayout(false); - groupBox1.PerformLayout(); - groupBox3.ResumeLayout(false); - tabControl1.ResumeLayout(false); - tabPage2.ResumeLayout(false); - tabPage2.PerformLayout(); - tabPage5.ResumeLayout(false); - tabPage5.PerformLayout(); - tabPage6.ResumeLayout(false); - groupBox2.ResumeLayout(false); - groupBox2.PerformLayout(); - groupBox4.ResumeLayout(false); - groupBox4.PerformLayout(); - groupBox5.ResumeLayout(false); - groupBox5.PerformLayout(); - ResumeLayout(false); - } - - #endregion - private GroupBox groupBox1; - private RadioButton rb_production; - private RadioButton rb_Verify; - private RadioButton rb_test; - private RadioButton rb_local; - private GroupBox groupBox3; - private RichTextBox logTBox; - private TextBox en_TBox; - private Label label1; - private TextBox exePathTbox; - private Label label9; - private TextBox serviceDisplayNameTBox; - private TextBox serviceNameTBox; - private Label label11; - private Label label10; - private GroupBox groupBox2; - private Label label2; - private TextBox startOrStopServiceTbox; - private GroupBox groupBox4; - private GroupBox groupBox5; - private TextBox servicePortTBox; - private Label label6; - private OpenFileDialog openFileDialog1; - private OpenFileDialog openPublishFileDialog; - private FolderBrowserDialog folderBrowserDialog1; - private MaterialSkin2DotNet.Controls.MaterialButton netCorePublishBtn; - private MaterialSkin2DotNet.Controls.MaterialButton vuePublishBtn; - private MaterialSkin2DotNet.Controls.MaterialButton startBakBtn; - private MaterialSkin2DotNet.Controls.MaterialButton bakConfigSaveBtn; - private MaterialSkin2DotNet.Controls.MaterialButton createService_Btn; - private MaterialSkin2DotNet.Controls.MaterialButton serviceConfigSaveBtn; - private MaterialSkin2DotNet.Controls.MaterialButton stopServiceBtn; - private MaterialSkin2DotNet.Controls.MaterialButton startServiceBtn; - private MaterialSkin2DotNet.Controls.MaterialButton selectPathBtn; - private MaterialSkin2DotNet.Controls.MaterialButton deleteService_Btn; - private MaterialSkin2DotNet.Controls.MaterialMaskedTextBox backPathTBox; - private MaterialSkin2DotNet.Controls.MaterialMaskedTextBox backExePath; - private MaterialSkin2DotNet.Controls.MaterialMaskedTextBox bakDbName; - private MaterialSkin2DotNet.Controls.MaterialLabel materialLabel3; - private MaterialSkin2DotNet.Controls.MaterialLabel materialLabel2; - private MaterialSkin2DotNet.Controls.MaterialLabel materialLabel1; - private MaterialSkin2DotNet.Controls.MaterialMaskedTextBox publishFolderTBox; - private MaterialSkin2DotNet.Controls.MaterialMaskedTextBox publishFileTBox; - private MaterialSkin2DotNet.Controls.MaterialLabel materialLabel5; - private MaterialSkin2DotNet.Controls.MaterialLabel materialLabel4; - private MaterialSkin2DotNet.Controls.MaterialButton selectPublishFolderPathBtn; - private MaterialSkin2DotNet.Controls.MaterialButton selectPublishFilePathBtn; - private MaterialSkin2DotNet.Controls.MaterialButton sshNetCorePublishBtn2; - private MaterialSkin2DotNet.Controls.MaterialButton sshNetCorePublishBtn; - private MaterialSkin2DotNet.Controls.MaterialButton sshVuePublishBtn; - private TabControl tabControl1; - private TabPage tabPage2; - private TabPage tabPage5; - private TabPage tabPage6; - private RadioButton rb_USDemo; - } -} \ No newline at end of file diff --git a/PublishSite/PublishForm.cs b/PublishSite/PublishForm.cs deleted file mode 100644 index 418a15c2..00000000 --- a/PublishSite/PublishForm.cs +++ /dev/null @@ -1,1098 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.Management.Automation; -using System.Management.Automation.Runspaces; -using System.Security; -using System.Diagnostics; -using System.Net; -using Renci.SshNet; -using Serilog; -using Newtonsoft.Json.Linq; -using System.ServiceProcess; -using Renci.SshNet.Messages; -using System.Management; -using System.IO; -using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window; -using System.Management.Automation.Host; -using SharpCompress.Common; -using MaterialSkin2DotNet.Controls; -using MaterialSkin2DotNet; -using Renci.SshNet.Compression; -using SharpCompress.Archives; -using System.Collections.ObjectModel; -using SharpCompress.Writers; -using SharpCompress.Writers.Zip; -using SharpCompress.Archives.Zip; - -namespace PublishSite -{ - public partial class PublishForm : MaterialForm - { - public PublishForm() - { - InitializeComponent(); - - Serilog.Log.Logger = new LoggerConfiguration() - .WriteTo.File("logs\\log.txt", rollingInterval: RollingInterval.Day) - .CreateLogger(); - - uiContext = SynchronizationContext.Current; - - } - - public string EnvName = ""; - - public JObject jObjectCofig; - - public string Host = ""; - - public string UserName = ""; - - public string Password = ""; - - SynchronizationContext uiContext; - - private void WinformLog(string message, Color? color = null) - { - if (InvokeRequired) - { - Invoke(new Action(() => WinformLog(message, color))); - return; - } - - - logTBox.SelectionColor = color == null ? Color.Green : (Color)color; - logTBox.AppendText($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}: {message}" + Environment.NewLine); - Serilog.Log.Information(message); - } - - - #region 切换环境 配置回写 - - private void rb_Env_CheckedChanged(object sender, EventArgs e) - { - - - //本地 - if (rb_local.Checked) - { - EnvName = "本地"; - WinformLog($"当前操作环境切换为: 本地", Color.DarkRed); - - var configJson = File.ReadAllText("appsettings.local.json"); - - jObjectCofig = JObject.Parse(configJson); - - - - - } - //测试 - if (rb_test.Checked) - { - EnvName = "测试"; - WinformLog($"当前操作环境切换为: 测试", Color.DarkRed); - - var configJson = File.ReadAllText("appsettings.Development.json"); - - jObjectCofig = JObject.Parse(configJson); - } - //验证 - if (rb_Verify.Checked) - { - EnvName = "验证"; - WinformLog($"当前操作环境切换为: 验证", Color.DarkRed); - - var configJson = File.ReadAllText("appsettings.Verify.json"); - - jObjectCofig = JObject.Parse(configJson); - } - //生产 - if (rb_production.Checked) - { - EnvName = "生产"; - WinformLog($"当前操作环境切换为: 生产", Color.DarkRed); - - var configJson = File.ReadAllText("appsettings.Production.json"); - - jObjectCofig = JObject.Parse(configJson); - } - - if (rb_USDemo.Checked) - { - EnvName = "美国演示"; - WinformLog($"当前操作环境切换为: 美国演示", Color.DarkRed); - - var configJson = File.ReadAllText("appsettings.USDemo.json"); - - jObjectCofig = JObject.Parse(configJson); - } - - - #region 界面控件赋值 - - - - Host = rb_local.Checked ? "" : jObjectCofig["Credential"]["Host"].ToString(); - UserName = rb_local.Checked ? "" : jObjectCofig["Credential"]["UserName"].ToString(); - Password = rb_local.Checked ? "" : jObjectCofig["Credential"]["Password"].ToString(); - - - serviceNameTBox.Text = jObjectCofig["DefaultService"]["ServiceName"].ToString(); - serviceDisplayNameTBox.Text = jObjectCofig["DefaultService"]["ServiceDisplayName"].ToString(); - servicePortTBox.Text = jObjectCofig["DefaultService"]["ServicePort"].ToString(); - exePathTbox.Text = jObjectCofig["DefaultService"]["BinPath"].ToString(); - en_TBox.Text = jObjectCofig["DefaultService"]["Env"].ToString(); - - - - startOrStopServiceTbox.Text = jObjectCofig["DefaultService"]["ServiceName"].ToString(); - - - bakDbName.Text = jObjectCofig["BackUp"]["DataBaseName"].ToString(); - backPathTBox.Text = jObjectCofig["BackUp"]["BackPath"].ToString(); - backExePath.Text = jObjectCofig["DefaultService"]["BinPath"].ToString(); - - - var credentialNode = jObjectCofig["Credential"]; - - var defaultServiceNode = jObjectCofig["DefaultService"]; - - var BackUpNode = jObjectCofig["BackUp"]; - - - #endregion - - #region 按键控制 - if (rb_local.Checked) - { - startBakBtn.Enabled = false; - bakConfigSaveBtn.Enabled = false; - sshVuePublishBtn.Enabled = false; - sshNetCorePublishBtn.Enabled = false; - sshNetCorePublishBtn2.Enabled = false; - selectPublishFilePathBtn.Enabled = false; - selectPublishFolderPathBtn.Enabled = false; - } - else - { - startBakBtn.Enabled = true; - bakConfigSaveBtn.Enabled = true; - sshVuePublishBtn.Enabled = true; - sshNetCorePublishBtn.Enabled = true; - sshNetCorePublishBtn2.Enabled = true; - selectPublishFilePathBtn.Enabled = true; - selectPublishFolderPathBtn.Enabled = true; - } - #endregion - } - - - private void serviceConfigSaveBtn_Click(object sender, EventArgs e) - { - serviceConfigSaveBtn.Enabled = false; - var serviceName = serviceNameTBox.Text; - DialogResult dr = MessageBox.Show($"{EnvName}环境服务配置回写 ?", "保存提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); - - if (dr == DialogResult.OK) - { - var path = string.Empty; - if (rb_local.Checked) - { - path = "appsettings.local.json"; - - } - if (rb_test.Checked) - { - path = "appsettings.Development.json"; - - } - if (rb_Verify.Checked) - { - path = "appsettings.Verify.json"; - - } - if (rb_production.Checked) - { - path = "appsettings.Production.json"; - - } - if (rb_USDemo.Checked) - { - path = "appsettings.USDemo.json"; - - } - var configJson = File.ReadAllText(path); - - jObjectCofig = JObject.Parse(configJson); - - jObjectCofig["DefaultService"]["ServiceName"] = serviceNameTBox.Text.Trim(); - jObjectCofig["DefaultService"]["ServiceDisplayName"] = serviceDisplayNameTBox.Text.Trim(); - jObjectCofig["DefaultService"]["ServicePort"] = servicePortTBox.Text.Trim(); - jObjectCofig["DefaultService"]["BinPath"] = exePathTbox.Text.Trim(); - jObjectCofig["DefaultService"]["Env"] = en_TBox.Text.Trim(); - - - File.WriteAllText(path, jObjectCofig.ToString()); - - WinformLog("服务配置回写成功!"); - } - - serviceConfigSaveBtn.Enabled = true; - } - - private void bakConfigSaveBtn_Click(object sender, EventArgs e) - { - bakConfigSaveBtn.Enabled = false; - var serviceName = serviceNameTBox.Text; - DialogResult dr = MessageBox.Show($"{EnvName}环境备份配置回写 ?", "保存提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); - - if (dr == DialogResult.OK) - { - var path = string.Empty; - if (rb_local.Checked) - { - path = "appsettings.local.json"; - - } - if (rb_test.Checked) - { - path = "appsettings.Development.json"; - - } - if (rb_Verify.Checked) - { - path = "appsettings.Verify.json"; - - } - if (rb_production.Checked) - { - path = "appsettings.Production.json"; - - } - var configJson = File.ReadAllText(path); - - jObjectCofig = JObject.Parse(configJson); - - jObjectCofig["BackUp"]["DataBaseName"] = bakDbName.Text.Trim(); - jObjectCofig["BackUp"]["BackPath"] = backPathTBox.Text.Trim(); - - File.WriteAllText(path, jObjectCofig.ToString()); - - WinformLog("备份配置回写成功!"); - bakConfigSaveBtn.Enabled = true; - } - } - - #endregion - - #region 备份 - - - private async void startBakBtn_Click(object sender, EventArgs e) - { - if (rb_local.Checked) - { - WinformLog("本地环境不支持备份操作,懒得开发"); - return; - } - - await Task.Run(() => - { - - - using (var client = new SshClient(Host, UserName, Password)) - { - // 连接到远程服务器 - client.Connect(); - - try - { - var dbName = bakDbName.Text.Trim(); - var backRootPath = backPathTBox.Text.Trim(); - var serviceName = jObjectCofig["DefaultService"]["ServiceName"].ToString().Trim(); - - var programPath = backExePath.Text.Trim(); - var programFolder = Path.GetDirectoryName(programPath); - - var dbUser = jObjectCofig["BackUp"]["DBUser"].ToString().Trim(); - var dbPwd = jObjectCofig["BackUp"]["DBPwd"].ToString().Trim(); - - - var backupFolderPath = Path.Combine(backRootPath, DateTime.Now.ToString("yyyyMMdd")); - - //创建文件夹 - WinformLog("准备当日备份文件夹..."); - - var command = client.CreateCommand($"if not exist \"{backupFolderPath}\" mkdir \"{backupFolderPath}\""); - command.Execute(); - if (command.ExitStatus != 0) - { - throw new Exception($"Failed to create {backupFolderPath}."); - } - - - //停止服务 - WinformLog($"停止后台服务{serviceName}..."); - - var stopServiceCommand = client.CreateCommand($"sc stop \"{serviceName}\""); - stopServiceCommand.Execute(); - - if (stopServiceCommand.ExitStatus != 0) - { - WinformLog($"Failed to stop {serviceName}.", Color.Red); - } - - Task.Delay(1000); - //备份后端文件 - - WinformLog($"备份后端文件..."); - string archivePath = $"{backupFolderPath}\\NetCore_{DateTime.Now.ToString("yyyy-MM-dd HH_mm_ss")}.zip"; - var compressCommand = client.CreateCommand($"powershell.exe Compress-Archive -Path \"{programFolder}\\*.*\" -DestinationPath \"{archivePath}\" -Force"); - compressCommand.Execute(); - if (compressCommand.ExitStatus != 0) - { - WinformLog("Failed to compress and move folder contents.", Color.Red); - } - - //启动服务 - WinformLog($"启动后台服务{serviceName}..."); - - var startServiceCommand = client.CreateCommand($"sc start \"{serviceName}\""); - startServiceCommand.Execute(); - - if (startServiceCommand.ExitStatus != 0) - { - WinformLog($"Failed to start {serviceName}.", Color.Red); - } - - - //备份数据库 - - WinformLog($"开始备份数据库{dbName}..."); - - string databaseBackupPath = $"{backupFolderPath}\\db_{DateTime.Now.ToString("yyyy-MM-dd HH_mm_ss")}.bak"; - var sqlcommand = client.CreateCommand($"sqlcmd -S . -U \"{dbUser}\" -P \"{dbPwd}\" -Q \"BACKUP DATABASE [{dbName}] TO DISK='{databaseBackupPath}' WITH INIT\""); - sqlcommand.Execute(); - if (sqlcommand.ExitStatus != 0) - { - throw new Exception("Failed to backup database."); - } - - WinformLog($"备份操作执行结束..."); - } - catch (Exception ex) - { - - WinformLog($"{ex.Message}", Color.Red); - } - } - - - - }); - } - - - #endregion - - - - - #region 服务的创建与删除 - - - private string ExecuteCommand(string command) - { - ProcessStartInfo procStartInfo = - new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command); - - procStartInfo.RedirectStandardOutput = true; - procStartInfo.UseShellExecute = false; - procStartInfo.CreateNoWindow = true; - - System.Diagnostics.Process proc = new System.Diagnostics.Process(); - proc.StartInfo = procStartInfo; - proc.Start(); - - return proc.StandardOutput.ReadToEnd(); - } - - private void createService_Btn_Click(object sender, EventArgs e) - { - var serviceName = serviceNameTBox.Text.Trim(); - - var apiBinPath = exePathTbox.Text.Trim(); - - var apiPort = servicePortTBox.Text.Trim(); - - var envName = en_TBox.Text.Trim(); - - var serviceDisplayName = serviceDisplayNameTBox.Text.Trim(); - - - - if (ServiceController.GetServices().Any(t => t.ServiceName == serviceName)) - { - WinformLog($"设置的服务名称已存在,请更换", Color.Red); - - return; - } - - - - - var createTestStr = $"sc create {serviceName} binPath= \"{apiBinPath} --urls=\"http://127.0.0.1:{apiPort}\" --env {envName}\" DisplayName= \"{serviceDisplayName}\" start= auto"; - - WinformLog(createTestStr); - - string output = ExecuteCommand(createTestStr); - - WinformLog(output); - - - WinformLog("服务创建执行结束"); - - } - - private async void deleteService_Btn_Click(object sender, EventArgs e) - { - var serviceName = serviceNameTBox.Text; - DialogResult dr = MessageBox.Show($"{EnvName}环境删除服务:{serviceName}?", "删除提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); - - if (dr == DialogResult.OK) - { - - await Task.Run(() => - { - - if (rb_local.Checked) - { - ProcessStartInfo startInfo = new ProcessStartInfo(); - startInfo.FileName = "cmd.exe"; - startInfo.Arguments = $"/c sc query {serviceName} | find \"STATE\" | find /i \"RUNNING\" && net stop {serviceName} & sc delete {serviceName}"; - - // 在后台运行命令行窗口 - startInfo.WindowStyle = ProcessWindowStyle.Hidden; - startInfo.CreateNoWindow = true; - - using (Process process = new Process()) - { - process.StartInfo = startInfo; - process.Start(); - - process.WaitForExit(); - - if (process.ExitCode == 0) - { - WinformLog($"{serviceName} 服务已经成功删除!"); - } - else - { - WinformLog($"尝试停止并删除 {serviceName} 服务失败,请检查是否拥有管理员权限或服务是否存在。", Color.Red); - } - } - } - else - { - - using (var client = new SshClient(Host, UserName, Password)) - { - // 连接到远程服务器 - client.Connect(); - - // 停止服务 - string stopCommand = $"sc stop {serviceName}"; - using (var stopCmd = client.CreateCommand(stopCommand)) - { - WinformLog(stopCommand); - var stopOutput = stopCmd.Execute(); - WinformLog(stopOutput); - } - - // 删除服务 - string deleteCommand = $"sc delete {serviceName}"; - using (var deleteCmd = client.CreateCommand(deleteCommand)) - { - WinformLog(deleteCommand); - var deleteOutput = deleteCmd.Execute(); - WinformLog(deleteOutput); - } - - // 断开SSH连接 - client.Disconnect(); - } - - } - - - }); - - - } - - } - - private void selectPathBtn_Click(object sender, EventArgs e) - { - if (rb_local.Checked) - { - - OpenFileDialog dialog = new OpenFileDialog(); - if (dialog.ShowDialog() == DialogResult.OK) - { - exePathTbox.Text = dialog.FileName; - - WinformLog($"部署启动文件选择成功", Color.Green); - } - } - else - { - WinformLog("远程环境不支持直接选择目录", Color.Red); - } - } - - #endregion - - - - #region 测试环境发布 - - private async void vuePublishBtn_Click(object sender, EventArgs e) - { - - vuePublishBtn.Enabled = false; - - await Task.Run(() => - { - - using (var client = new SshClient("123.56.94.154", "Administrator", "WHxckj2019")) - { - // 连接到远程服务器 - client.Connect(); - - //&& ./IRaCIS_Vue_Web.bat - string command = $@"cd C:\Users\Administrator\VueSourceCode && npm i && npm run build"; - - - using (var cmd = client.CreateCommand(command)) - { - - WinformLog("测试环境:开始执行前端发布"); - - WinformLog(command); - - - var output = cmd.Execute(); - - WinformLog(output); - - - var output3 = cmd.Execute($@"xcopy /Y /Q ""C:\Users\Administrator\VueSourceCode\dist\index.html"" ""D:\Develop\PublishSite\IRaCIS.Vue.Web\dist\"""); - - WinformLog(output); - - WinformLog("测试环境:前端发布成功"); - } - - // 断开SSH连接 - client.Disconnect(); - } - - }); - - vuePublishBtn.Enabled = true; - - } - - private async void netCorePublishBtn_Click(object sender, EventArgs e) - { - - netCorePublishBtn.Enabled = false; - await Task.Run(() => - { - - - using (var client = new SshClient("123.56.94.154", "Administrator", "WHxckj2019")) - { - // 连接到远程服务器 - client.Connect(); - - string command = $@"C:\Users\Administrator\bat\IRaCIS_Core_API.bat"; - - - using (var cmd = client.CreateCommand(command)) - { - - WinformLog("测试环境:开始执行后端发布"); - - WinformLog(command); - - var output = cmd.Execute(); - - WinformLog(output); - - WinformLog("测试环境:后端发布成功"); - } - - // 断开SSH连接 - client.Disconnect(); - } - - }); - netCorePublishBtn.Enabled = true; - - } - - #endregion - - - #region 服务的启动与停止 - - private async void startServiceBtn_Click(object sender, EventArgs e) - { - //startServiceBtn.Enabled = false; - - - uiContext.Post((state) => - { - // 访问控件并更新它们 - startServiceBtn.Enabled = false; - }, null); - - await Task.Run(() => - { - if (rb_local.Checked) - { - ServiceController controller = new ServiceController($"{startOrStopServiceTbox.Text}"); - if (controller?.Status == ServiceControllerStatus.Running) - { - controller.Stop(); - controller.WaitForStatus(ServiceControllerStatus.Stopped); - } - else - { - WinformLog("服务不是停止状态", Color.Red); - } - return; - } - - using (var client = new SshClient(Host, UserName, Password)) - { - // 连接到远程服务器 - client.Connect(); - - string command = $@"sc start {startOrStopServiceTbox.Text}"; - - - using (var cmd = client.CreateCommand(command)) - { - WinformLog(command); - - var output = cmd.Execute(); - - WinformLog(output); - } - - // 断开SSH连接 - client.Disconnect(); - } - - - - }); - uiContext.Post((state) => - { - // 访问控件并更新它们 - startServiceBtn.Enabled = true; - }, null); - //startServiceBtn.Enabled = true; - } - - private async void stopServiceBtn_Click(object sender, EventArgs e) - { - //startServiceBtn.Enabled = false; - uiContext.Post((state) => - { - // 访问控件并更新它们 - startServiceBtn.Enabled = false; - }, null); - await Task.Run(() => - { - if (rb_local.Checked) - { - ServiceController controller = new ServiceController($"{startOrStopServiceTbox.Text}"); - if (controller?.Status == ServiceControllerStatus.Running) - { - controller.Stop(); - controller.WaitForStatus(ServiceControllerStatus.Stopped); - } - else - { - WinformLog("服务不是启动状态", Color.Red); - } - return; - } - - - using (var client = new SshClient(Host, UserName, Password)) - { - // 连接到远程服务器 - client.Connect(); - - string command = $@"sc stop {startOrStopServiceTbox.Text}"; - - - using (var cmd = client.CreateCommand(command)) - { - WinformLog(command); - - var output = cmd.Execute(); - - WinformLog(output); - } - - // 断开SSH连接 - client.Disconnect(); - } - - }); - //startServiceBtn.Enabled = true; - - uiContext.Post((state) => - { - // 访问控件并更新它们 - startServiceBtn.Enabled = true; - }, null); - } - - #endregion - - - #region 上传文件到远程服务器发布 - - - private void selectPublishFilePathBtn_Click(object sender, EventArgs e) - { - - - OpenFileDialog dialog = new OpenFileDialog(); - if (dialog.ShowDialog() == DialogResult.OK) - { - publishFileTBox.Text = dialog.FileName; - - WinformLog($"远程部署文件选择成功", Color.Green); - } - - } - - private void selectPublishFolderPathBtn_Click(object sender, EventArgs e) - { - FolderBrowserDialog dialog = new FolderBrowserDialog(); - dialog.Description = "选择目录"; - if (dialog.ShowDialog() == DialogResult.OK) - { - publishFolderTBox.Text = dialog.SelectedPath; - - WinformLog($"远程部署后端发布文件夹选择成功", Color.Green); - } - } - - private async void sshVuePublishBtn_Click(object sender, EventArgs e) - { - - - var desTinationFoder = jObjectCofig["BackUp"]["VuePublishFolder"].ToString(); - - - sshVuePublishBtn.Enabled = false; - var filePath = publishFileTBox.Text; - - var realName = Path.GetFileName(filePath); - - var storeTempName = $"{Guid.NewGuid()}_{realName}"; - - if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath)) - { - WinformLog($"请选择存在的文件才能开始发布", Color.Red); - return; - } - - - WinformLog($"开始上传前端部署文件{Path.GetFileName(filePath)}..."); - - - await Task.Run(() => - { - - - using (var client = new SshClient(Host, UserName, Password)) - { - client.ConnectionInfo.Encoding = System.Text.Encoding.UTF8; - // 连接到远程服务器 - client.Connect(); - - using (var scpClient = new ScpClient(Host, UserName, Password)) - { - scpClient.Connect(); - - using (var fileStream = new FileStream(filePath, FileMode.Open)) - { - scpClient.Upload(fileStream, @$"/{storeTempName}"); - } - - scpClient.Disconnect(); - - WinformLog($"上传{realName}结束"); - } - - string command = $@"xcopy /Y /Q ""C:\{storeTempName}"" ""{desTinationFoder}"""; - - //拷贝文件到发布文件夹 - using (var cmd = client.CreateCommand(command)) - { - WinformLog(command); - - var output = cmd.Execute(); - - WinformLog(output); - } - - //删除临时文件 - - var delCommand = $"move /Y \"{Path.Combine(desTinationFoder, storeTempName)}\" \"{Path.Combine(desTinationFoder, realName)}\" && del C:\\{storeTempName}"; - using (var cmd = client.CreateCommand(delCommand)) - { - WinformLog(delCommand); - - var output = cmd.Execute(); - - WinformLog(output); - } - - WinformLog($"清除零时文件{storeTempName}完成"); - - // 断开SSH连接 - client.Disconnect(); - - WinformLog($"前端发布成功"); - } - - - }); - - - WinformLog($"前端你发布结束"); - - sshVuePublishBtn.Enabled = true; - - } - - private async void sshNetCorePublishBtn_Click(object sender, EventArgs e) - { - - - var binPath = jObjectCofig["DefaultService"]["BinPath"].ToString(); - - var desTinationFoder = Path.GetDirectoryName(binPath); - - - var filePath = publishFileTBox.Text; - var realName = Path.GetFileName(filePath); - - var storeTempName = $"{Guid.NewGuid()}_{realName}"; - - if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath)) - { - WinformLog($"请选择存在的文件才能开始发布", Color.Red); - return; - } - - if (!string.Equals(Path.GetExtension(realName), ".zip", StringComparison.OrdinalIgnoreCase)) - { - WinformLog($"后端远程发布的压缩包必须是zip格式,并且不带目录", Color.Red); - return; - } - - sshNetCorePublishBtn.Enabled = false; - - WinformLog($"开始上传后端部署文件{realName}..."); - - await NetCoreZipPublishAsync(filePath, desTinationFoder); - - WinformLog($"后端发布结束"); - - sshNetCorePublishBtn.Enabled = true; - } - - private async Task NetCoreZipPublishAsync(string filePath, string desTinationFoder) - { - var realName = Path.GetFileName(filePath); - - var storeTempName = $"{Guid.NewGuid()}_{realName}"; - - - - await Task.Run(async () => - { - using (var client = new SshClient(Host, UserName, Password)) - { - client.ConnectionInfo.Encoding = System.Text.Encoding.UTF8; - // 连接到远程服务器 - client.Connect(); - - using (var scpClient = new ScpClient(Host, UserName, Password)) - { - scpClient.Connect(); - - using (var fileStream = new FileStream(filePath, FileMode.Open)) - { - scpClient.Upload(fileStream, @$"/{storeTempName}"); - } - - scpClient.Disconnect(); - - WinformLog($"上传{realName}结束"); - } - - - //后端发布,处理压缩包流程 - - //停止服务 - stopServiceBtn_Click(null, null); - - await Task.Delay(2000); - - //解压到发布的目录 - string expandCommand = $"Expand-Archive -Path '{Path.Combine("C:\\", storeTempName)}' -DestinationPath '{desTinationFoder}' -Force"; - - - using (var cmd = client.CreateCommand($"powershell.exe {expandCommand}")) - { - WinformLog(expandCommand); - - var output = cmd.Execute(); - - WinformLog(output); - } - - //启动服务 - startServiceBtn_Click(null, null); - - - //删除临时文件 - - var delCommand = $" del C:\\{storeTempName}"; - - using (var cmd = client.CreateCommand(delCommand)) - { - WinformLog(delCommand); - - var output = cmd.Execute(); - - WinformLog(output); - } - - WinformLog($"清除零时文件{storeTempName}完成"); - - // 断开SSH连接 - client.Disconnect(); - - - } - }); - } - - - - - 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(); - - var localSourceFolder = publishFolderTBox.Text; - - var desTinationFoder = Path.GetDirectoryName(binPath); - - - - WinformLog($"开始打包该文件夹下的内容..."); - - var filePath = Path.Combine(localSourceFolder, "NetCorePublish.zip"); - - if (File.Exists(filePath)) - { - File.Delete(filePath); - } - - try - { - await Task.Run(() => - { - //ZipFile.CreateFromDirectory(localSourceFolder, filePath, CompressionLevel.Fastest, false); - - - var files = Directory.GetFiles(localSourceFolder, "*", SearchOption.AllDirectories); - - using (var archive = ZipArchive.Create()) - { - foreach (var file in files) - { - archive.AddEntry(Path.GetRelativePath(localSourceFolder, file), file); - } - - archive.SaveTo(filePath, new WriterOptions(CompressionType.Deflate)); - } - - WinformLog("文件已成功压缩为 " + filePath); - - }); - - WinformLog($"打包结束"); - } - catch (Exception ex) - { - - WinformLog("错误:" + ex.Message, Color.Red); - } - - - - - await NetCoreZipPublishAsync(filePath, desTinationFoder); - - WinformLog($"后端发布结束"); - sshNetCorePublishBtn2.Enabled = true; - } - - #endregion - - - - private void PublishForm_Load(object sender, EventArgs e) - { - - //MaterialSkinManager manager = MaterialSkinManager.Instance; - //manager.AddFormToManage(this); - //manager.Theme = MaterialSkinManager.Themes.LIGHT; - } - } - -} diff --git a/PublishSite/PublishForm.resx b/PublishSite/PublishForm.resx deleted file mode 100644 index 05cc54b9..00000000 --- a/PublishSite/PublishForm.resx +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - 165, 17 - - - 349, 17 - - \ No newline at end of file diff --git a/PublishSite/PublishSite.csproj b/PublishSite/PublishSite.csproj deleted file mode 100644 index 5b2c5b6b..00000000 --- a/PublishSite/PublishSite.csproj +++ /dev/null @@ -1,55 +0,0 @@ - - - - WinExe - net6.0-windows - enable - true - enable - AnyCPU;x64 - icons8-publish-100.ico - - - - - - - - - Always - true - PreserveNewest - - - Always - true - PreserveNewest - - - Always - true - PreserveNewest - - - Always - true - PreserveNewest - - - Always - true - PreserveNewest - - - - - - - - - - - - - - \ No newline at end of file diff --git a/PublishSite/appsettings.Development.json b/PublishSite/appsettings.Development.json deleted file mode 100644 index 0f611532..00000000 --- a/PublishSite/appsettings.Development.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "BackUp": { - "DataBaseName": "IRaCIS_New_Tet", - "DBUser": "sa", - "DBPwd": "dev123456DEV", - "BackPath": "D:\\Develop\\PublishSite\\发布备份", - "VuePublishFolder": "D:\\Develop\\PublishSite\\IRaCIS.Vue.Web\\dist", - "ConnectionStrings": "Server=.;Database=IRaCIS_New_Tet;Trusted_Connection=True;TrustServerCertificate=true" - }, - "Credential": { - "Host": "123.56.94.154", - "UserName": "Administrator", - "Password": "WHxckj2019" - }, - "DefaultService": { - "ServiceName": "NetCore.IRaCIS.Api", - "ServiceDisplayName": "CICD_IRaCIS.Core.API", - "ServicePort": "7100", - "BinPath": "D:\\Develop\\PublishSite\\IRaCIS.NetCore.API\\IRaCIS.Core.API.exe", - "Env": "Development" - }, - -} diff --git a/PublishSite/appsettings.Production.json b/PublishSite/appsettings.Production.json deleted file mode 100644 index 74aea2de..00000000 --- a/PublishSite/appsettings.Production.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "BackUp": { - "DataBaseName": "IRaCIS.Production", - "DBUser": "sa", - "DBPwd": "zhanying2021", - "BackPath": "D:\\Product_Lib", - "VuePublishFolder": "D:\\Publish\\IRaCIS.Production\\IRaCIS.Vue.Web\\dist", - "ConnectionStrings": "Server=.;Database=IRaCIS.Production;Trusted_Connection=True;TrustServerCertificate=true" - }, - "Credential": { - "Host": "101.132.193.237", - "UserName": "Administrator", - "Password": "SHzyyl2021" - }, - "DefaultService": { - "ServiceName": "Production.NetCore.IRaCIS.Api", - "ServiceDisplayName": "Production_IRaCIS.Core.API", - "ServicePort": "7080", - "BinPath": "D:\\Publish\\IRaCIS.Production\\IRaCIS.NetCore.API\\IRaCIS.Core.API.exe", - "Env": "Production" - } -} diff --git a/PublishSite/appsettings.USDemo.json b/PublishSite/appsettings.USDemo.json deleted file mode 100644 index dcb7cddd..00000000 --- a/PublishSite/appsettings.USDemo.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "BackUp": { - "DataBaseName": "IRaCIS_Demo_US", - "DBUser": "sa", - "DBPwd": "zhanying2021", - "BackPath": "C:\\IRaCIS_Publish\\备份", - "VuePublishFolder": "C:\\IRaCIS_Publish\\PublishSite\\IRaCIS.Vue.Web\\dist", - "ConnectionStrings": "Server=.;Database=IRaCIS_Demo_US;Trusted_Connection=True;TrustServerCertificate=true" - }, - "Credential": { - "Host": "47.90.161.85", - "UserName": "Administrator", - "Password": "SHzyyl2021" - }, - "DefaultService": { - "ServiceName": "USDemo.NetCore.IRaCIS.Api", - "ServiceDisplayName": "USDemo_IRaCIS.Core.API", - "ServicePort": "7000", - "BinPath": "C:\\IRaCIS_Publish\\PublishSite\\IRaCIS.NetCore.API\\IRaCIS.Core.API.exe", - "Env": "USDemo" - } - -} diff --git a/PublishSite/appsettings.Verify.json b/PublishSite/appsettings.Verify.json deleted file mode 100644 index a6446b5f..00000000 --- a/PublishSite/appsettings.Verify.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "BackUp": { - "DataBaseName": "IRaCIS_Verify", - "DBUser": "sa", - "DBPwd": "dev123456DEV", - "BackPath": "D:\\Develop\\Verify_PublishSite\\发布备份", - "VuePublishFolder": "D:\\Develop\\Verify_PublishSite\\IRaCIS.Vue.Web\\dist", - "ConnectionStrings": "Server=.;Database=IRaCIS_Verify;Trusted_Connection=True;TrustServerCertificate=true" - }, - "Credential": { - "Host": "123.56.94.154", - "UserName": "Administrator", - "Password": "WHxckj2019" - }, - "DefaultService": { - "ServiceName": "Verify.NetCore.IRaCIS.Api", - "ServiceDisplayName": "Verify_IRaCIS.Core.API", - "ServicePort": "7020", - "BinPath": "D:\\Develop\\Verify_PublishSite\\IRaCIS.NetCore.API\\IRaCIS.Core.API.exe", - "Env": "Staging" - } -} diff --git a/PublishSite/appsettings.local.json b/PublishSite/appsettings.local.json deleted file mode 100644 index d898247d..00000000 --- a/PublishSite/appsettings.local.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "BackUp": { - "DataBaseName": "IRaCIS_New_Tet", - "DBUser": "sa", - "DBPwd": "dev123456DEV", - "BackPath": "D:\\Develop\\PublishSite\\发布备份", - "ConnectionStrings": "Server=.;Database=IRaCIS;Trusted_Connection=True;TrustServerCertificate=true" - }, - "Credential": { - "Host": "123.56.94.154", - "UserName": "Administrator", - "Password": "WHxckj2019" - }, - "DefaultService": { - "ServiceName": "NetCore.IRaCIS.Api", - "ServiceDisplayName": "CICD_IRaCIS.Core.API", - "ServicePort": "7100", - "BinPath": "D:\\Develop\\PublishSite\\IRaCIS.NetCore.API\\IRaCIS.Core.API.exe", - "Env": "Development" - } -} diff --git a/PublishSite/icons8-publish-100.ico b/PublishSite/icons8-publish-100.ico deleted file mode 100644 index 6e86f583920dacae9b6914d356c0d8ed6d6fcf9c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 41662 zcmeHQ30M?I79Ka*b@$8ex@Y#=>oec(CNYuI3vWDwh(u5%XyTV+6|WdIYFw|ND0m+M zPhyN>yl_p7XCxx1FoTFj4Uu>Q&M*Qq193e8efwSy1wF$YJy1Q2vB$5ddR^VGUj2W+ zy1KemshZ)x5hGOi_c_&$WR>b!l}gnL10GUkW1!>o>#;$l`u#KJARJKsCgDGpHZwjOtKeR!W=yHTon zp4EN$JMYGK=^pv$<1Kq2uRse$rXM7QlDqezy!xRKZj?*AhIF63TmVZFHdhm;t$q51 zGCMpeM!%SA3p*K)Y4zor=Qbp-nbxKI5Xif(t;LpMEO&hT^ta&SH{kB`z9E10C@!#F z#(VaWjM&>8m!UtFPMSIcR)3P>b}ks#Gh-7fef&cgdkP;ko<%My+|30mum7uW!KwT! z7JQ^;o`!Q*iY$&X{CLM-oj3&@y9_zyF?<*`UodQ%A`T6I2eQAtXo3BWidzu7XdT?V zbI;;9Z!SpRzBD!QaoiL5&>6FWiWh@+*6$@TnAeJ&q-{X_5g`1GZ% zyiNMk8#Dpd*zlH#kFa-=VRGUvffMo-TV-t9^)Ynr776P&?}qORb#PHvQV+XAV+Cj{ z{s)T_Hi6+mrOTXLE-r=H^H)LUneQOy!e#g{ehst>82G^3J2<#WiKrhmpLiD_W%y0XG7E*lVJGU??U!B z`znjePPS`mJ^y=Hzd>CkJ_&7d%m{F7oY1W z{o1hiAT@m_^VQRYM^kb__k_6qa-|!}2ifysY%GL^N5ifI=|JP(DKnOUUz-69!e7h{ z`Bi&tN3Uv+F+M|5`HQK-`0HT$Nt>MPNzH_weTKq?t4C~N?x?P`w#k!^mtG3$(>5Ud zjF)$CrS+UxEPMF`KRj^cU=@vD4y7N0m%aKy!n!0VyIlZBvyMP(?|!xOXK?Z-hE$( z*Dzl8(GuafBOh>-S5&0_1rI&~0|TG-YZGcZmV4f&4>yJnb}g-CbnG$+uH2{_BRZ-Z z%ae-_rk__#b1@!Vkd9WZ`g(Qh8hMLhCs!O1H4YA>Zga^;9v41v|I$WYe7yK#&~pKu zBW}yZ1JfH8F&d6${`W`8hu)MmfEORAr&+szL072nVAwS_&d50jw0_6*q@O%1^r3}% z+haw0?Z)HbAL?A*>m|wC)-RxE&@6B2Ul=TU{GYVu+DS!rlC=s(42Puk|YQj_$IA` zy3|fFe|Ze}c#k(1dSjLst3Qj0myu&;32O`VJYmZ8#SWkM*z=+3F)Lts!jcAYLAH1} zANjnwAbrIq%^1c5i;He%!tA-R_}nc*n6I`E2!}(*PucaCxMd&1x7Ti1q29HuE^@}&@=QP8oZ!Bx<<4xLFnKy`+_u*O zZ{`!!uKD;b|W z!J4F%7T1dP$e3Qin-ARYyu+EjhthUH@1WrpV&;vY zUI6bW{D7gn9w+wr5OXnUrBQgk9vrn&;AH*AM3-$5+vQ3c*Hs_!Uf0F)6QtTe>w;s( zPlY}~ufve2QLu8=vU<+~r0OF7>C|;FbnGz-#xKzcn7*G-0e!;f3x1Na=Tn>gIcuZ3 z2Ty~ED-6PQ6IU9b+bi$mxG)qBAKf9D59SB=D=UO+NM=64@&re5@aN&f>O!7Ag8j!x zsTlG;FEeM4@XW4LPcbKTe$v`IxZeH})}s`rl^~^Oq-k_7yTla3v-su+t+cw55(n5P3y|C2g<>NSm*WY z=|9IgVl3KpSE^ldoM+8R$gtJId@pI^Dv#iT-lwN;9Eh=#GhKY^_#e?9ry)0K7~hfu zb7wjkC%$b5yM6BM%r?DIJylNp9qFdM6KJ3CZ3}01iu1+$gjiafFC|T!1auCE6}T24 z<$UoutW0q%&TnX%_MbU>58e@;Jo3;_(p|NmaG*JaqxWf~==}a#n#){}US8#kZNzbC zmCmH;$^+BJ=)ikoqS!7eX~KiJaP~fp6kQEDhj;n3eu!hx(T%~8*R@3z>fa$IF11p@HeKSAIjdrDx^(vaE5u@Z_Nf>#@R>y70uqm2%m+9Lv{f z4eCBTFyyJDu;RpTX`ILE>nyf~2OV=~XiR&F?GwFMALq&6ph5fkqn!_(aY6ZFK1R*U z7y1&y$DM)7b-DjCsEhDj?x7_m>A&Q8Kg*?y#@?>-Azp)OiZtB=bbm;(8{2^Ga$zTz zUfh>5)|sDB{n>ceojzf!EPL;-+uu6pp$37}Yb@zlky#EBhuy^0H;}5EC3HQG}zhS<_jT3`< zfhXYO2{verIe*77e;(^Kfo3 z1M$>0gcrP)=9@>fCUq!s{6x?7cyc7H85=dhi0^8|H=pKjcKN||F>LR$F~sVPCtLHh zL(yd$0loh0GdD~cAKaVP51-`^5d!|dU)s`>FVO#2Wcw=RsDglkfP#R6fP#R6fP#R6 zfP#R6fP#R6fP#R6fP#R6fP#R6fP%o|fdJb(LvaO~{3Oa1su-c#to|9QmKL%~)m$t; z!cV7HH^U<}=T{?alnktq?_>Hc3@vM9is;v(MlKMfIyu9MJjW{ETCT~iEze3ubIre+ z@*6BSH``x(y;)|pLy(000#;m&oKY*A%Xd{SsJ-5dXPs=uyG~z>P=1|ko$pL;X?49c zxy~N*`SxXV`E_`iWx89;KeJ4ClUN2Os$vBDpnx5yk!ux#IiJbRtmLO^WL98vE4f9D z%nS&uks05$_j^tGwelSEfm%7kN;VsW4r8_ts)YxPbutJgSj$h9B3U?JBm-H1 zE?T1>gc`P}lYuM}%LOQ-i?j2EM4(6}1u-I-AgS|rAcL{^y6e#ZY9VU%AxD80@*`?4 LMENBBIOP8Waj6t3