From 95a3869e7a91085f6d8ac34a623151ae8869783f Mon Sep 17 00:00:00 2001 From: lhiven Date: Wed, 23 Apr 2025 11:19:35 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96lotname=E5=8F=AA?= =?UTF-8?q?=E8=83=BD=E8=BE=93=E5=85=A5=E5=AD=97=E6=AF=8D=E3=80=81=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E3=80=81=E4=B8=8B=E5=88=92=E7=BA=BF=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E4=B8=94=E4=B8=8B=E5=88=92=E7=BA=BF=E4=B8=8D=E8=83=BD=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E8=BF=9E=E7=BB=AD=E5=87=BA=E7=8E=B02=E4=B8=AA?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/FormMain.cs | 25 +++++++++++++++++------ Rs.DeweyTester/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Rs.DeweyTester/FormMain.cs b/Rs.DeweyTester/FormMain.cs index a4fe5af..50e1970 100644 --- a/Rs.DeweyTester/FormMain.cs +++ b/Rs.DeweyTester/FormMain.cs @@ -838,18 +838,31 @@ namespace Rs.MotionPlat private void txtLotName_KeyUp(object sender, KeyEventArgs e) { StringBuilder msg = new StringBuilder(); - string reg = "[\\w,&,\\.]"; + //string reg = "[\\w,&,\\.]"; + //string reg = "([a-z 0-9 A-Z]*_{0,1})"; + string reg = "\\w"; TextBox textBox = (TextBox)sender; - string text=textBox.Text; - foreach(char c in text.ToCharArray()) + string text = textBox.Text; + char[] charData = text.ToCharArray(); + for (int i=0;i< charData.Length;i++) { - if(Regex.IsMatch(c.ToString(), reg)) + if (Regex.IsMatch(charData[i].ToString(), reg)) { - msg.Append(c); + if(i>0 && charData[i]=='_') + { + if (charData[i] != charData[i-1]) + { + msg.Append(charData[i].ToString()); + } + } + else + { + msg.Append(charData[i].ToString()); + } } } textBox.Text = msg.ToString(); - //textBox.Select(msg.Length, 0); + textBox.Select(msg.Length, 0); } private void timer3_Tick_1(object sender, EventArgs e) diff --git a/Rs.DeweyTester/Properties/AssemblyInfo.cs b/Rs.DeweyTester/Properties/AssemblyInfo.cs index 42d27c9..efe2604 100644 --- a/Rs.DeweyTester/Properties/AssemblyInfo.cs +++ b/Rs.DeweyTester/Properties/AssemblyInfo.cs @@ -31,6 +31,6 @@ using System.Runtime.InteropServices; // //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: - [assembly: AssemblyVersion("20.25.27.2")] + [assembly: AssemblyVersion("20.25.28.1")] //[assembly: AssemblyVersion("1.0.0.0")] //[assembly: AssemblyFileVersion("1.0.0.0")]