【发布时间】:2015-12-07 12:55:29
【问题描述】:
我的程序需要这样的用户输入:
Dim yesorno = InputBox("Do you have more credit cards?", "Thomas Shera")
If yesorno = "Yes" Or "yes" Then
Name = InputBox("You are a rich person, enjoy infinite credit card bill.")
Else
MsgBox("You poor person, you have only " & dcreditcards & " credit cards.")
End If
具体的违规行二:
If yesorno = "Yes" Or "yes" Then
这给出了错误:
Microsoft.VisualBasic.dll 中出现“System.InvalidCastException”类型的未处理异常
附加信息:从字符串“yes”到类型“Boolean”的转换无效。
关于如何解决此问题的想法,使“是”或“是”不会导致无效错误异常?
【问题讨论】:
标签: vb.net