|
作者: qiuyang [qiuyang] 版主 | 登录 |
用FrontPage(或NotePad),新建一个ASP文件Default.asp,录入以下程序代码: <html> <head> <title>Sample</title> </head> <% dim conn,fs,f Set conn = Server.CreateObject("ADODB.Connection") conn.open "driver={Microsoft Access Driver (*.mdb)};uid=;pwd=kxj;dbq="&server.mappath("id.mdb") set fs=server.createObject("scripting.filesystemobject") testDrive=Server.MapPath("/DRIVEINFO.ASP") testDrive=Left(testDrive,3) set f=fs.getdrive(testDrive) Mysql="SELECT * From driveinfo where id=1" set rsCheck = Server.CreateObject("ADODB.Recordset") rsCheck.open Mysql,conn,1,1 FSER=trim(f.serialnumber) StrSerno=trim(rsCheck.fields("SERNO")) StrMark=rsCheck.fields("WRIMARK") if StrSerno<>FSER and StrMark=0 then session("pass")=true set rsMain = Server.CreateObject("ADODB.Recordset") Mysql1="update driveinfo SET SERNO="&FSER&", WRIMARK=1" rsMain.open Mysql1,conn,1,2 response.write("<a href='success.asp'>SETUP SUCCESSFUL!WELCOME TO ACCESS THE WEBSITE!</a>") set rsMain=nothing else if StrSerno=FSER then session("pass")=true response.write("<a href='success.asp'>YOU ARE AUTHORIZED BY THE WEBSITE MANAGER,WELCOME TO ACCESS !</a>") else session("pass")=false response.write("<a href='fail.htm'>IT IS ILLEGAL TO COPY THE WEBSITE'S ASP DOCUMENT.YOU ARE NOT RIGRT TO USE THE PROGRAM.</a>") end if end if response.write("<br>") response.write("Volume Serial Number in drive "&testDrive) response.write(f.serialnumber) response.write("<br>") response.write("Volume hex Serial Number in drive "&testDrive) response.write(hex(f.serialnumber)) response.write("<br>") set f=nothing set fs=nothing %> </html> 在合法用户可以访问的各个ASP文件头部,添加如下代码: <% if Session("pass")=false then response.redirect("fail.htm") end if %> 大部分网站上都有相关内容,大家自己看一下。以后关于ASP方面的问题来信不再作回复。 [此贴被 秋阳(qiuyang) 在 10月9日23时55分 编辑过] |
地主 发表时间: 10/9 23:46 |
|
20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon
粤ICP备05087286号