(编辑:jimmy 日期: 2024/12/28 浏览:2)
default.asp
<html>
<head>
<title>星河影动之磁盘序列号加密代码存取管理</title>
</head>
<% dim conn,fs,f
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};uid=;pwd=3302;dbq="&server.mappath("id.mdb")
set fs=server.createObject("scripting.filesystemobject")
testDrive=Server.MapPath("/DRIVEINFO.ASP")
' 通过MapPath获得当前盘盘符.
testDrive=Left(testDrive,3)
set f=fs.getdrive(testDrive)
' 调用GetDrive方法赋予驱动器一个变量.
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")
' Wrimark值为0表示代表合法用户未安装系统,值为1代表该系统已安装.值为1且序列号与当前盘不符时,则判定为非法复制用户
if StrSerno<>FSER and StrMark=0 then
' 如是第一次安装,则设置写盘标志为1.
session("pass")=true
' 定义用户Session,并设置为全局ASP文档标识变量.
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'>安装成功!欢迎光临随风起舞存取站点!</a>"=
set rsMain=nothing
else
if StrSerno=FSER then
' 合法用户可再次进入.
session("pass")=true
response.write("<a href='success.asp'>再次欢迎!您已被随风起舞授权,允许进行存取...</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
set f=nothing
set fs=nothing
%>
</html>