标题:我用VS2005做个小论坛遇到问题了.用的是VB.NET的语言.做到注册页面了
只看楼主
chenjinbinlove
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-11-18
 问题点数:0 回复次数:2 
我用VS2005做个小论坛遇到问题了.用的是VB.NET的语言.做到注册页面了
打开数据库和数据库的值进行比对


把值添入数据库

代码写不清楚...大家帮帮..感谢!!!
搜索更多相关主题的帖子: NET 语言 页面 注册 
2008-11-18 20:40
chenjinbinlove
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-11-18
得分:0 
我用的是ACCESS数据库哦。。大家帮忙下哦..
本人水平不高哦
2008-11-18 20:46
chenjinbinlove
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-11-18
得分:0 
我把我的代码给大家看下..要改和添加的大家帮忙下

    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
2008-11-18 20:50



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-245040-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.036075 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved