无法从文本框中读取文本

时间:2014-05-25 17:28:12

标签: vb.net

变量中的值为空。我的代码是:

        Private Sub button1_click()

        Dim uname As String
        uname = Request.Form("user_name")
        Dim pword As String
        pword = Request.Form("password")
        If uname = "admin" And pword = "admin" Then
            MsgBox("OK")
        Else
            MsgBox("NOT")
        End If

    End Sub

1 个答案:

答案 0 :(得分:0)

我不确定你想要什么,但是如果只是为了在文本框中获取文字......

    Private Sub button1_click()

    Dim uname As String
    uname = TextBoxName.Text
    Dim pword As String
    pword = TextBoxName.Text
    If uname = "admin" And pword = "admin" Then
        MsgBox("OK")
    Else
        MsgBox("NOT")
    End If
End Sub