我在尝试传递字符串数据类型的值时遇到了问题。在Visual Basic中传递字符串值
我能做些什么来解决这个问题?
发件人:
Private Sub verButton_Click(sender As Object, e As EventArgs) Handles verButton.Click
If chkauth.auth(csBox.Text, pwBox.Text) Then
mainForm.Enabled = True
infoLbl.Visible = False
Else
infoLbl.Visible = True
End If
End Sub
收件人:
Public Function auth(ByVal cs As String, ByVal pw As String)
Select Case cs
Case "Chauix"
If pw = "ihartcha" Then
MsgBox("Authentication successful!", MsgBoxStyle.Information, "Success")
Return True
Else
Return False
End If
Case "Brink"
If pw = "Jesusismylife" Then
MsgBox("Authentication successful!", MsgBoxStyle.Information, "Success")
Return True
Else
Return False
End If
Case Else
Return False
End Select
End Function
它总是导致一个错误,当我尝试执行,导致它的事件。
这是VB6还是VB.NET? – MPelletier
只是想知道,如果你使用你的实际用户名和密码?你可能想改变你的例子,如果你是:) – ScottC
Nah。他们不是。他们只是展示我同班同学的样本:D – Wix