嗨,我想了解并识别错误并修复以下Visual Basic代码中的代码

时间:2015-03-27 00:42:45

标签: vb.net

Private Sub btnDisplay_Click(...) Handles btnDisplay.Click    
    Dim major As String    
    major = "Computer Science"  
    If major = "Business" Or "Computer Science" Then      
    txtOutput.Text = "Yes"   
    End If  
End Sub

1 个答案:

答案 0 :(得分:0)

使用= 运算符

Private Sub btnDisplay_Click(...) Handles btnDisplay.Click    
    Dim major As String    
    major = "Computer Science"  
    If major = "Business" Or major = "Computer Science" Then      
    txtOutput.Text = "Yes"   
    End If  
End Sub