以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 员工手机当天再次登陆不需输入密码自动进入(Cookie记住密码),想实现点击如下图中员工事先选定的三个图来验证: (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=117421) |
-- 作者:ytzn -- 发布时间:2018/4/12 12:43:00 -- 员工手机当天再次登陆不需输入密码自动进入(Cookie记住密码),想实现点击如下图中员工事先选定的三个图来验证: 怎么实现? 多谢老师! [此贴子已经被作者于2018/5/11 16:59:07编辑过]
|
-- 作者:ytzn -- 发布时间:2018/4/12 12:44:00 -- 或者怎样获取点击的图的文件名? |
-- 作者:有点甜 -- 发布时间:2018/4/12 14:40:00 -- 参考
http://www.jq22.com/search?seo=%E8%A7%A3%E9%94%81
如果要cookie记住密码,参考,可以设置存放时间的。(或者再用一个cookie记录登陆日期)
http://www.foxtable.com/mobilehelp/scr/0042.htm
|
-- 作者:ytzn -- 发布时间:2018/4/12 15:07:00 -- 谢谢有点甜老师! 如下面处理也能实现我想要的对应图片名,但是图太小看不清 Dim e As RequestEventArgs = args(0) Dim wb As New WeUI wb.AddPageTitle("","pageheader","WeUI","微信网页设计样式库") With wb.AddGrid("","g1") .Add("c1","", "./images/001.jpg").Attribute = "on click=\'jav ascript:alert(""c1"")\'" .Add("c2","", "./images/002.jpg").Attribute = "on click=\'jav ascript:alert(""c2"")\'" .Add("c3","", "./images/003.jpg").Attribute = "" .Add("c4","", "./images/004.jpg").Attribute = "" .Add("c5","", "./images/005.jpg").Attribute = "" .Add("c6","", "./images/006.jpg").Attribute = "" .Add("c7","", "./images/007.jpg").Attribute = "" .Add("c8","", "./images/008.jpg").Attribute = "" .Add("c9","", "./images/009.jpg").Attribute = "" .Add("c10","", "./images/010.jpg").Attribute = "" .Add("c11","", "./images/011.jpg").Attribute = "" .Add("c12","", "./images/012.jpg").Attribute = "on click=\'jav ascript:alert(""c12"")\'" End With e.WriteString(wb.Build) 如果能点击获取一楼图片的文件名,我就能实现我想要的验证 [此贴子已经被作者于2018/4/12 15:13:53编辑过]
|
-- 作者:有点甜 -- 发布时间:2018/4/12 16:06:00 -- 用<img />标签
http://www.foxtable.com/mobilehelp/scr/0097.htm
http://www.foxtable.com/mobilehelp/scr/0015.htm
|
-- 作者:ytzn -- 发布时间:2018/5/11 16:46:00 -- 水平有限,采用特笨的办法实现,分享给初学的狐友: Select Case e.Path Case "logon.htm","" Functions.Execute("logon",e) Case "logon_yz.htm" Functions.Execute("logon_yz",e) Case Else Dim usernam As String="" Dim Password As String="" If e.Cookies.ContainsKey("usernam") Then usernam= e.Cookies("usernam") \'从cookie中获取用户名 Password= e.Cookies("password") \'从cookie中获取用户密码 End If If Password>"" AndAlso usernam>"" Then Dim d2 As Date = Date.now If e.Cookies.ContainsKey("dlsj") Then Dim d1 As Date = e.Cookies("dlsj") \'获取上次登陆时间 Dim t As TimeSpan = d2 - d1 If t.TotalMinutes>150 Then \'如果距上次登陆时间超过150分钟则图片验证 Functions.Execute("logon_yz",e) Return End If Else \'如果新打开浏览器则图片验证 Functions.Execute("logon_yz",e) Return End If e.AppendCookie("dlsj",d2) \'保存登录时间以备用 Select Case e.Path Case "xs_xzml.htm" Functions.Execute("xs_xzml",e) Case "xs_list.htm" Functions.Execute("xs_List",e) \'分页显示 End Select Else \'如果密码登陆超过3天清空了,则重新登陆 Functions.Execute("logon",e) End If End Select =============================================================================================================== Functions.Execute("logon_yz",e)内容如下: Dim e As RequestEventArgs = args(0) Dim cmd As New SQLCommand cmd.ConnectionName = vars("_conn") Dim dt As DataTable Dim dr As DataRow Dim yhdr As DataRow Dim drs As List(Of DataRow) Dim dlyz As String ="" \'记录选择的图名 Dim dlyzj As Integer=1 \'记录选择图的个数,共需选择3个图 Dim i As Integer=1 Dim usernam As String="" If e.Cookies.ContainsKey("usernam") Then usernam= e.Cookies("usernam") \'从cookie中获取用户名 End If yhdr=DataTables("用户表").sqlfind("用户名=\'" & usernam & "\'") \'用户表中含图名1 图名2 图名3 三列放三个需验证的图 If yhdr IsNot Nothing Then cmd.CommandText = "select * fro m {登陆验证图} where 1=1" \'该表有图名 随机数 排序三列 dt = cmd.ExecuteReader() Dim wb As New WeUI If e.getValues.ContainsKey("xz") Then \'如果选择了图 dlyz=e.getValues("xz") \'等于选择的图名 dlyzj=e.Cookies("dlyzj")+1 \'记录选择图的个数 End If For Each dr In dt.DataRows dr("随机数")= Rand.Next(1000,9990) Next If dlyzj=1 Then dt.ReplaceFor("随机数",1, "图名=\'" & yhdr("图名1") & "\'") \'将用户预先设定的第一个图的随机数改为1,以保证出现在头21个图中供选择 ElseIf dlyzj=2 Then \'第一个图选完 If yhdr("图名1")<>e.getValues("xz") Then \'如选择的第一个图不符,则退出重新登陆 wb.AddForm("","form1","logon_yz.htm") With wb.AddButtonGroup("form1","btg6", False) .Add("btn9", "OK","button","logon.htm?tctc=\'tctc\'") \'退出重新密码登陆 End With e.WriteString(wb.Build) Return "" End If dt.ReplaceFor("随机数",1, "图名=\'" & yhdr("图名2") & "\'") \'将用户预先设定的第二个图的随机数改为1,以保证出现在头21个图中供选择 ElseIf dlyzj=3 Then \'第二个图选完 If yhdr("图名2")<>e.getValues("xz") Then \'如选择的第二个图不符,则退出重新登陆 wb.AddForm("","form1","logon_yz.htm") With wb.AddButtonGroup("form1","btg6", False) .Add("btn9", "OK","button","logon.htm?tctc=\'tctc\'") \'退出重新密码登陆 End With e.WriteString(wb.Build) Return "" End If dt.ReplaceFor("随机数",1, "图名=\'" & yhdr("图名3") & "\'") \'将用户预先设定的第三个图的随机数改为1,以保证出现在头21个图中供选择 Else \'第三个图选完 If yhdr("图名3")<>e.getValues("xz") Then \'如选择的第三个图不符,则退出重新登陆 wb.AddForm("","form1","logon_yz.htm") With wb.AddButtonGroup("form1","btg6", False) .Add("btn9", "OK","button","logon.htm?tctc=\'tctc\'") \'退出重新密码登陆 End With e.WriteString(wb.Build) Return "" End If Dim d2 As Date = Date.now e.AppendCookie("dlsj",d2) \'保存登录时间以备用 Functions.Execute("logon",e) Return "" End If wb.AppendCookie("dlyzj",dlyzj) drs = dt.Select("随机数<9999","随机数") \'按随机数排列下 For Each dr In drs dr("随机数")= Rand.Next(1000,9990) dr("排序")=i i=i+1 Next drs = dt.Select("排序<22","随机数") \'取前21个图 wb.AddPageTitle("","pageheader","","") With wb.AddGrid("","g1") For Each dr In drs .Add("c1","","./images/dlyz/" & dr("图名") & ".jpg","logon_yz.htm?xz=" & dr("图名")) \'xz=选择的图名 Next End With e.WriteString(wb.Build) End If
|