简体   繁体   中英

login form without database in vb.net

I am trying to create a simple Login form without database connection in vb.net but I am getting error when tried to execute it.

My code is:

<script runat="server">
Sub Page_Load
    If (txtuname.Text == "xxx") AND (txtpass.Text == "xxx") Then
        response.write("Welcome user")
        Server.Transfer("login2.aspx")
    Else
        response.write("Invalid username and password")
        Server.Transfer("login.aspx")
    End IF
End sub
</script>

And the error I am getting is:

Expression expected at:If (txtuname.Text == "xxx") AND (txtpass.Text == "xxx") Then

How to resolve this?

由于这是vb,因此应为:

If (txtuname.Text = "xxx") AND (txtpass.Text = "xxx") Then

If (txtuname.Text = "xxx") AND (txtpass.Text = "xxx") Then写为If (txtuname.Text = "xxx") AND (txtpass.Text = "xxx") Then也可以使用xml文件代替用户名和密码来代替代码

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM