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")) {