这里我有我的简单代码,包含数组的列表和2个文本框,当我按下按钮脚本时,必须检查文本是否在数组列表中找到Textbox2。你能帮我解决它吗? 谢谢!检查数组中是否存在textbox.text
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim pins() As String = {"dgge", "wada", "caas", "reaa"}
If TextBox2.Text = pins() Then
TextBox1.Text = "Succes"
End If End Sub
'如果pins.IndexOf(textBox2.Text)< > -1 Then ... End If'(假设我记得VB正确。)ps另见:http://stackoverflow.com/a/11112305/298053 – 2013-02-22 20:16:28