Foxtable(狐表)用户栏目专家坐堂 → 两种登录方式


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

主题:两种登录方式

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


加好友 发短信
等级:八尾狐 帖子:1938 积分:14865 威望:0 精华:0 注册:2016/4/28 9:58:00
两种登录方式  发帖心情 Post By:2020/6/17 22:12:00 [只看该作者]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:新建文本文档.txt


改两个登录方式,不同提交按钮问题,谢谢

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


加好友 发短信
等级:超级版主 帖子:107135 积分:544918 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/6/18 9:33:00 [只看该作者]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:新建文本文档(2).txt


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


加好友 发短信
等级:八尾狐 帖子:1938 积分:14865 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2020/6/18 15:46:00 [只看该作者]

老师,请问改了哪里,没看出来

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


加好友 发短信
等级:超级版主 帖子:107135 积分:544918 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/6/18 15:51:00 [只看该作者]

打开2个记事本,逐行比对。或者网上下载个文件比较软件

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


加好友 发短信
等级:八尾狐 帖子:1938 积分:14865 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2020/6/18 22:14:00 [只看该作者]

老师按上面做后点btn1提交时密码账正确但不跳转,按btn5提交帐号密码正确但还是刷新一下logon.htm就完了,整不走了

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


加好友 发短信
等级:超级版主 帖子:107135 积分:544918 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/6/18 22:41:00 [只看该作者]

新建项目做个例子发上来测试

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


加好友 发短信
等级:八尾狐 帖子:1938 积分:14865 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2020/6/19 6:32:00 [只看该作者]

终于理清了,谢谢!

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


加好友 发短信
等级:八尾狐 帖子:1938 积分:14865 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2020/6/20 13:33:00 [只看该作者]

If  e.Path <> "zc.htm"  AndAlso e.path<> "czmm.htm" Then '身份验证
    If e.Path = "logon.htm"
        If e.Cookies("jsdnok")="yes" Or  e.Cookies("xsdnok")="yes"
            wb.InsertHTML("<meta http-equiv='Refresh' c>")' '直接跳转到首页
        Else
            If e.PostValues("btn1")="btn1"                 
                Dim cmd As new SQLCommand
                cmd.C
                cmd.CommandText ="Se\ect 身份证号,password from {用户} where 身份证号='" & e.PostValues("username") & "'"
                Dim dt As DataTable =  cmd.ExecuteReader
                Dim dr As DataRow = dt.find("身份证号='" & e.PostValues("usrername") & "' And [password]=  '" & e.PostValues("password")  &"'")
                If dr IsNot Nothing
                    wb.InsertHTML("<meta http-equiv='Refresh' c>")'
                    wb.AppendCookie("username",e.postvalues("username"))
                    wb.appendcookie("userjs","学生")
                    wb.appendcookie("xsdnok","yes")
                Else
                    wb.InsertHTML("<meta http-equiv='Refresh' c; url='logon.htm'>") '那么直接跳转到登录页面
                End If
                e.WriteString(wb.Build)
                Return '
            End If
            If e.PostValues("btn5")="btn5"
                Dim cmd1 As new SQLCommand
                cmd1.C
                cmd1.CommandText ="Se\ect DISTINCT 单位,部门,角色,密码  from {单位用户} "
                Dim dt1 As DataTable =  cmd1.ExecuteReader
                Dim dr As DataRow = dt1.find("单位='" & e.PostValues("单位") & "' And 部门= '" & e.PostValues("部门")  & "' And 密码=  '" & e.PostValues("密码")  &"'")
                If dr IsNot Nothing
                    wb.InsertHTML("<meta http-equiv='Refresh' c>")'
                    wb.AppendCookie("userdw",dr("单位"))
                    wb.AppendCookie("userbm",dr("部门"))
                    wb.appendcookie("userjs",dr("角色"))
                    wb.appendcookie("jsdnok","yes")
                Else
                    wb.InsertHTML("<meta http-equiv='Refresh' c; url='logon.htm'>") '那么直接跳转到登录页面
                End If
                e.WriteString(wb.Build)
                Return '
            End If
        End If
    End If
End If


老师,请问我为了理清这个关系这样改了,但不能跳转

[此贴子已经被作者于2020/6/20 13:33:10编辑过]

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


加好友 发短信
等级:超级版主 帖子:107135 积分:544918 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/6/20 14:06:00 [只看该作者]

调试看需要跳转的代码执行了没有?

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


加好友 发短信
等级:八尾狐 帖子:1938 积分:14865 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2020/6/20 21:10:00 [只看该作者]

If  e.Path <> "zc.htm"  AndAlso e.path<> "czmm.htm" Then '身份验证
    If e.Path = "logon.htm"
        If e.Cookies("dnok")="js" Or  e.Cookies("dnok")="xs"
            wb.InsertHTML("<meta http-equiv='Refresh' c>")' '直接跳转到首页
            e.WriteString(wb.Build)
            Return '
        Else
            If e.PostValues("btn1")="btn1"
                Dim cmd As new SQLCommand
                cmd.C
                cmd.CommandText = "SE/ECT 身份证号,password,_identify FROM {用户} WHERE 身份证号 = '" & e.PostValues("username") & "' and password ='" & e.PostValues("password") & "'"
                Dim dt As DataTable = cmd.ExecuteReader
                If dt.DataRows.count>0
                    wb.InsertHTML("<meta http-equiv='Refresh' c>")'
                    wb.AppendCookie("username",e.postvalues("username"))
                    wb.appendcookie("userjs","学生")
                    wb.appendcookie("dnok","xs")
                Else
                    wb.AddTopTips("","toptip1","用户名或密码错误或已停用!").msec = 3000
                    wb.InsertHTML("<meta http-equiv='Refresh' c; url='logon.htm'>") '那么直接跳转到登录页面
                End If
                e.WriteString(wb.Build)
                Return '
            End If
            If e.PostValues("btn5")="btn5"
                Dim cmd1 As new SQLCommand
                cmd1.C
                cmd1.CommandText ="Se/ect DISTINCT 单位,部门,角色,密码  from {单位用户} "
                Dim dt1 As DataTable =  cmd1.ExecuteReader
                Dim dr As DataRow = dt1.find("单位='" & e.PostValues("单位") & "' And 部门= '" & e.PostValues("部门")  & "' And 密码=  '" & e.PostValues("密码")  &"'")
                If dr IsNot Nothing
                    wb.InsertHTML("<meta http-equiv='Refresh' c>")'
                    wb.AppendCookie("userdw",dr("单位"))
                    wb.AppendCookie("userbm",dr("部门"))
                    wb.appendcookie("userjs",dr("角色"))
                    wb.appendcookie("dnok","js")
                Else
                    wb.InsertHTML("<meta http-equiv='Refresh' c; url='logon.htm'>") '那么直接跳转到登录页面
                End If
                e.WriteString(wb.Build)
                Return '
            End If
        End If        
    End If
End If
'

老师,请调试行了,还有些问题
1、红色的部分想增加个密码错误提示,不能显示出来呢,
2、如何用代码控制page2处于当前显示,缺省的是page1处于当前显示
With wb.AddTabBar("", "tb1", 1)
    .AddPage("page1","学生家长登录","../tubiao/xsdn.png")
    .AddPage("page2","学校班级登录","../tubiao/jsdn.png")
End With


[此贴子已经被作者于2020/6/21 13:15:20编辑过]

 回到顶部
总数 22 1 2 3 下一页