注册 登录
编程论坛 VB.NET论坛

我用VS2005做个小论坛遇到问题了.用的是VB.NET的语言.做到注册页面了

chenjinbinlove 发布于 2008-11-18 20:40, 1026 次点击
打开数据库和数据库的值进行比对


把值添入数据库

代码写不清楚...大家帮帮..感谢!!!
2 回复
#2
chenjinbinlove2008-11-18 20:46
我用的是ACCESS数据库哦。。大家帮忙下哦..
本人水平不高哦
#3
chenjinbinlove2008-11-18 20:50
我把我的代码给大家看下..要改和添加的大家帮忙下

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click

        name.Text = ""
        password1.Text = ""
        password2.Text = ""
        email.Text = ""
        homepage.Text = ""
        note.Text = ""

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim strname, strpassword1, strpassword2, strnote, stremail, strhomepage, strpassword As String
        '读取用户输入数据

        strname = "name.Text"
        strpassword1 = "password1.Text"
        strpassword2 = "password2.Text"
        stremail = "email.Text"
        strhomepage = "homepage.Text"
        strnote = "note.Text"
        '检查输入的内容是否有为空的数据
        If strname = "" Then
            Response.Write("账号不能为空")
            Response.End()

        End If
        If strpassword1 = "" Then
            Response.Write("密码不能为空")
            Response.End()
        End If
        '检查两个密码值是否相同
        If strpassword1 = strpassword2 Then
            strpassword = strpassword1
        Else
            Response.Write("确认两次密码一致")
            Response.End()


        End If
        '打开数据库和数据库的值进行比对
        Dim conn As String
        conn = "DBQ=" + Server.MapPath("db1.mdb") + ";Defaultdir=;DRIVER={Microsoft Aceess Driver(*.mdb)};"



        '把值添加入数据库



        Response.Write("恭喜你注册成功")


    End Sub
1