Skip to content

Commit

Permalink
Merge pull request #15 from Ovler-Young/自动纠正串号
Browse files Browse the repository at this point in the history
feat(parser): 自动纠正串号
  • Loading branch information
Ovler-Young authored Jul 29, 2023
2 parents 485db52 + e2b2a37 commit 4018b3b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions AdnmbBackup-gui/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
{
Expand Down

0 comments on commit 4018b3b

Please sign in to comment.