Foxtable(狐表)用户栏目项目发布 → 登录代码


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

主题:登录代码

美女呀,离线,留言给我吧!
chengzhang
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:49 积分:410 威望:0 精华:0 注册:2011/9/5 15:05:00
登录代码  发帖心情 Post By:2011/9/11 14:22:00 [只看该作者]

 

Dim uName As String = e.Form.Controls("txtName").Value
Dim pwd As String = e.Form.Controls("txtpwd").value
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.C
If uName = "" Then
    Messagebox.show("请输入用户名!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
    Return
Else If pwd = ""
    Messagebox.show("密码不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
    Return
End If
cmd.CommandText = "Select * From {userInfo} Where [userID] = '" & uName.trim() & "'"
dt = cmd.ExecuteReader
If dt Is not Nothing Then 

    dr = dt.DataRows(0)
    If e.Form.Controls("txtpwd").Value = dr("userPwd").trim() Then
        _UserName = uName
        _UserGroup = dr("userDES")
        MessageBox.Show("登录成功!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Else
        Messagebox.show("密码错误!" ,"提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
    End If
Else
    MessageBox.Show("用户名或密码错误,请重新输入!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
    e.Form.Controls("txtpwd").value = ""
End If

[此贴子已经被作者于2011-9-15 20:08:27编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
明帆
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:12 积分:171 威望:0 精华:0 注册:2011/9/22 7:16:00
  发帖心情 Post By:2011/9/24 20:04:00 [只看该作者]

 测试一下,顺便学习,谢谢!

 回到顶部
帅哥哟,离线,有人找我吗?
willsniper
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:1 积分:71 威望:0 精华:0 注册:2011/10/18 8:10:00
  发帖心情 Post By:2011/10/18 8:15:00 [只看该作者]

没有防注入?


 回到顶部