2013-10-02 53 views
0

從字符串「FalseTrue」轉換爲鍵入「Boolean」無效。我如何在這種情況下解決它? Label5.Text必須包含這些內容,因爲它們提供了包括日期在內的全部轉換時間。從字符串「FalseTrue」轉換爲鍵入「Boolean」是無效問題

If ((Label5.Text.Contains("8:00") Or Label5.Text.Contains("1:35")) & (Label5.Text.Contains("PM"))) Then 
     WebControl1.Source = New Uri("http://www.flalottery.com/play4.do") 
     Label1.Text = "Loading in 7 seconds..." 
     Label2.Text = "Loading in 7 seconds..." 
     Refresh.Start() 
End If 

Winforms VB.NET 2012 Express。

+0

解決。再次感謝。 –

回答

2

你已經使用的邏輯And運營商的字符串連接運算符&代替:

If ((Label5.Text.Contains("8:00") Or Label5.Text.Contains("1:35")) And (Label5.Text.Contains("PM"))) Then 
+0

謝謝你們兩位。這真的很晚,我只是注意到了這一點。 –

2

使用使用VB &的象徵符號,將加入兩個值,你要使用And代替

+0

謝謝你們倆。這真的很晚,我只是注意到了這一點。 –

相關問題