以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  登陆代码必需改?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=144541)

--  作者:2900819580
--  发布时间:2019/12/24 7:53:00
--  

Dim UserName As String = e.Form.Controls("UserName").Value
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.C
If UserName = ""  Then
    Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If
cmd.CommandText = "S elect * From {Users} Where [Name] = \'" & UserName & "\'"
dt = cmd.ExecuteReader

If dt.DataRows.Count = 0 Then
    Messagebox.show("此用户不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If
dr = dt.DataRows(0)

If e.Form.Controls("PassWord").Value = dr("Password") Then
    _UserName = UserName
    _UserPessWord = dr("PassWord")

end if

 

    If _UserPessWord = "123456" Then
        Messagebox.show("密码为初始密码,非常不安全,请修改用户密码!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
        Forms("修改密码").open
        Forms("修改密码").Controls("name").text = e.Form.Controls("UserName").text
        Forms("修改密码").Controls("OP").text = e.Form.Controls("PassWord").text
        Exit Sub
    Else
        e.Form.Controls("But登录服务器").performclick
        e.Form.Close
    End If

 


--  作者:有点蓝
--  发布时间:2019/12/24 8:55:00
--  
这种要自己做用户管理:http://www.foxtable.com/webhelp/topics/2048.htm

然后在afteropenproject事件查询用户的密码如果是 "123456",就打开用户修改窗口