为什么下面的代码不起作用?
Private Function resolveSiteName(ByVal plantName As String, ByVal siteName As String) As Integer
Dim siteId As Integer = Nothing
Dim fullName As String = plantName & siteName
Select Case fullName
Case fullName.Contains("Example" And "Example2" And "Example3")
siteId = 0
End Select
Return siteId
End Function
我猜我Select Case fullName
错了,因为在调试它时,满足条件并且它只是跳过分配siteId
.
我也试过这个
Case fullName.Equals("Exactly what full name is")
只是为了测试看看这是否可行......它仍然跳过了分配部分。
我在这里想念什么?