From 8cce51203e63dfd239404a1262906c064e7c8a7c Mon Sep 17 00:00:00 2001 From: gongxh Date: Thu, 5 May 2022 09:53:00 +0800 Subject: [PATCH] 1 --- CleanMachineHMI/Utils/frmUtil.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CleanMachineHMI/Utils/frmUtil.cs b/CleanMachineHMI/Utils/frmUtil.cs index 16c1964..327cf6a 100644 --- a/CleanMachineHMI/Utils/frmUtil.cs +++ b/CleanMachineHMI/Utils/frmUtil.cs @@ -265,9 +265,10 @@ namespace CleanMachineHMI.Utils } else { - var control = (KryptonComboBox)form.Controls.Find(controlCode,true)[0]; + var control = (KryptonComboBox)form.Controls.Find(controlCode, true)[0]; var str = ""; - foreach (var item in control.Items) { + foreach (var item in control.Items) + { str += $"{item},"; } @@ -324,7 +325,8 @@ namespace CleanMachineHMI.Utils /// private static void WriteLangFile(string fileName, string txt) { - var fileDir = System.Windows.Forms.Application.StartupPath.Split(new string[] { @"bin\Debug" }, StringSplitOptions.RemoveEmptyEntries)[0] + "Lang\\"; + // var fileDir = System.Windows.Forms.Application.StartupPath.Split(new string[] { @"bin\Debug" }, StringSplitOptions.RemoveEmptyEntries)[0] + "Lang\\"; + var fileDir = "Lang\\"; try { if (!Directory.Exists(fileDir))//如果文件夹不存在,就新建一个文件夹。 @@ -341,8 +343,9 @@ namespace CleanMachineHMI.Utils private static void AddzhCN(string key, string name, string options) { - if (string.IsNullOrEmpty(name) && string.IsNullOrEmpty(options)) { - Console.WriteLine(key+"空"); + if (string.IsNullOrEmpty(name) && string.IsNullOrEmpty(options)) + { + Console.WriteLine(key + "空"); return; } var codes = key.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);