我的消息框有问题。这是检查序列号是否已被使用的应用程序的一部分。如果是,它会显示错误消息,当单击“是”程序继续并执行某些功能时,“否”按钮结束。它工作正常,但它会向我显示两次消息框,我真的不明白为什么,请帮助
If File.Exists(pathSN) Then
Dim Findstring = IO.File.ReadAllText(pathSN)
If Findstring.Contains(Lookfor) Then
Dim msg = "Serial number has already been used"
Dim title = "Error"
Dim style = MsgBoxStyle.YesNo Or MsgBoxStyle.DefaultButton2 Or _
MsgBoxStyle.Critical
Dim response = MsgBox(msg, style, title)
MsgBox(msg, style, title)
If response = MsgBoxResult.Yes Then
wrlayout()
openlayout()
Exit Sub
Else
Exit Sub
End If
End If
End If