From e2b2a379c1a1cc5e8dfb3b4eafdaed49708e36b9 Mon Sep 17 00:00:00 2001 From: Ovler Date: Sat, 29 Jul 2023 23:27:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(parser):=20=E8=87=AA=E5=8A=A8=E7=BA=A0?= =?UTF-8?q?=E6=AD=A3=E4=B8=B2=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AdnmbBackup-gui/Form1.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/AdnmbBackup-gui/Form1.cs b/AdnmbBackup-gui/Form1.cs index 84ceec7..31935cc 100644 --- a/AdnmbBackup-gui/Form1.cs +++ b/AdnmbBackup-gui/Form1.cs @@ -46,8 +46,20 @@ private void button1_Click(object sender, EventArgs e) // 检查是否为纯数字 if (!id.All(char.IsDigit)) { - MessageBox.Show("请输入正确的串号"); - return; + try + { + id = new string(id.Where(char.IsDigit).ToArray()); + if (id.Length != 8) + { + MessageBox.Show("请输入正确的串号"); + return; + } + } + catch (Exception) + { + MessageBox.Show("请输入正确的串号"); + return; + } } if (!File.Exists("cookie.txt")) {