Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 在vb中选择带有连接字符串的大小写_Vb.net - Fatal编程技术网

Vb.net 在vb中选择带有连接字符串的大小写

Vb.net 在vb中选择带有连接字符串的大小写,vb.net,Vb.net,这是我的大学录取代码,但它不会运行 Public Class College_Admission Private Sub btnResult_Click(sender As Object, e As EventArgs) Handles btnResult.Click Dim score, rank As Integer score = txtScore.Text rank = txtRank.Text Select Case score And rank

这是我的大学录取代码,但它不会运行

Public Class College_Admission

Private Sub btnResult_Click(sender As Object, e As EventArgs) Handles btnResult.Click
    Dim score, rank As Integer
    score = txtScore.Text
    rank = txtRank.Text
    Select Case score And rank
        Case Is >= 90 and  >= 25
            lblResult.Text = "Congratulation, you can apply for this college!"
        Case Is >= 89 and >= 50
            lblResult.Text = "Congratulation, you can apply for this college!"
        Case Is >= 70 and  >= 75
            lblResult.Text = "Congratulation, you can apply for this college!"
        Case Else
            lblResult.Text = "Sorry, you can not apply this college."

    End Select
End Sub
End Class

此代码有什么问题?

不要为此使用Select。因为你有两个条件要检查,所以它不起作用。只要这样做:

If (score >= 90 And rank >= 25) Or (score >= 89 And rank >= 50) Or (score >= 70 And rank >= 75) Then
    lblResult.Text = "Congratulations, you can apply to this college!"
Else
    lblResult.Text = "Sorry, you cannot apply to this college."
End If

Select Case score And rank
我不确定语法是否是这样的。+1你赢了我:)我只是想知道你为什么说
Select Case
在他目前的情况下不起作用。?它会起作用的。看看我下面的答案。是的,
Select Case true
有点模糊,但
Select x和y
没有。对于实际上只是if/else场景的情况,使用Select是没有意义的。谁否决了这一点<代码>不起作用显然是正确的:推送错误的语法。。。收到错误的答案
If/Else
是最正确的。