我只是一名 10 年级的编程学生。错误是:Conversion from string "alan" to type 'Boolean' is not valid
。我永远无法绕过它。错误在它说的那一行(If firstname = "alan" Or "Alan" Then)
。这是代码:
Module Module1
Sub Main()
Dim firstname As String
Console.WriteLine("Hello and welcome to Alan's Computer: Press enter to continue")
Console.ReadLine()
Console.WriteLine("Please enter your first name")
firstname = Console.ReadLine()
If firstname = "alan" Or "Alan" Then
Console.WriteLine("Welcome")
Else
Console.WriteLine("You may not enter {0}", firstname)
End If
End Sub
End Module