Foxtable(狐表)用户栏目专家坐堂 → 求网页用户注册时用户名不能重复的代码


  共有2500人关注过本帖树形打印复制链接

主题:求网页用户注册时用户名不能重复的代码

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110784 积分:563852 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/9/8 9:23:00 [显示全部帖子]

使用find查询判断

Else
     Dim nms() As String = {"手机号","密码","注册日期","推广码"} '不能为空的列名数组 
            For Each nm As String In nms
                If e.PostValues.ContainsKey(nm) = False Then '生成错误提示页 
                    With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!") 
                        .icon = "Warn" '改变图标
                        .AddButton("btn1","返回").Attribute = ""
                    End With
                    e.WriteString(wb.Build)
                   Return "" '必须返回
                End If
            Next
dim drr as datarow = DataTables("用户").find("手机号='" & e.PostValues("手机号")  & "'")
if drr isnot nothing then
                    With wb.AddMsgPage("","msgpage","增加失败", "手机号已经注册!") 
                        .icon = "Warn" '改变图标
                        .AddButton("btn1","返回").Attribute = ""
                    End With
                    e.WriteString(wb.Build)
                   Return "" '必须返回
end if

 回到顶部