1 <html> 2 <body> 3 <% 4 ‘以下连接数据库,建立一个Connection对象实例conn 5 Set conn=Server.CreateObject("ADODB.Connection") 6 strConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Info.mdb") 7 conn.Open strConn 8 9 ‘以下利用Connection对象的Execute方法添加新记录 10 Dim strName,strPass 11 strName = Request.Form("T1") 12 strPass = Request.Form("T2") 13 strName="‘" & strName & "‘" 14 strPass="‘" & strPass & "‘" 15 16 sql="select * from tbInfo where strName=" & strName & "and strPass=" & strPass 17 ‘sql="& strName & strPass" 18 ‘response.write sql 19 20 21 Set rs=conn.Execute(sql) 22 23 if rs.BOF=true and rs.EOF=true then 24 response.Write "登录名或密码错误!" 25 %> 26 <a href="./Login.html">返回登录界面</a> 27 <% 28 else 29 strName = Request.Form("T1") 30 Set MyPageCounter=Server.CreateObject("MSWC.pagecounter") 31 MyPageCounter.PageHit 32 response.Write"" & strName&",欢迎您的第" 33 response.write MyPageCounter.Hits 34 response.Write"次到来!" 35 36 end if 37 conn.Close 38 39 %> 40 </body>
相比于check2.asp,第30、31行添加了一个网页计数器,第33行添输出了计数器的值“response.write MyPageCounter.Hits”
原文:https://www.cnblogs.com/chenyuyang06/p/10653621.html