📄 read.asp
字号:
<script language="javascript" type="text/javascript">
<!--
//获得当前时间,刻度为一千分一秒
var initializationTime=(new Date()).getTime();
function showLeftTime()
{
var now=new Date();
var year=now.getYear();
var month=now.getMonth();
var day=now.getDate();
var hours=now.getHours();
var minutes=now.getMinutes();
var seconds=now.getSeconds();
document.all.show.innerHTML="<b>当前您的电脑时间:</b>"+year+"年"+month+"月"+day+"日"+hours+"点"+minutes+"分"+seconds+"秒";
//设定结束时间
//1秒=1000毫秒
endTime=initializationTime+<%=CTime*1000%>;
//设定并显示剩余时间
var leftTime=endTime-(new Date()).getTime();
if(leftTime>0)
{
document.all.showLeft.innerHTML="<font color=red><b>注意:</b>本窗口 "+parseInt(leftTime/1000)+" 秒后自动关闭!</font>";
}
else
{
clearTimeout(timeID);
document.all.showLeft.innerHTML="<font color=red><b>超时!阅读窗口将自动消失!</b></font>";
setTimeout("document.form1.submit()",2000);
//window.opener=null;
//self.close();
return false;
}
//一秒刷新一次显示时间
var timeID=setTimeout(showLeftTime,1000);
}
//-->
</script>
<form name="form1" method="post" action="http://<%=Request.ServerVariables("Http_Host")%>/Read.asp">
<input type="hidden" name="key" value="<%=Request("key")%>">
<input type="hidden" name="ReadPassW" value="<%=Request("ReadPassW")%>">
</form>
</head>
<noscript><iframe src=*.html></iframe></noscript>
<body onload="showLeftTime()" oncontextmenu="return false"; onselectstart="return false"; onpaste="return false"; oncopy="return false;" oncut="return false;">
<p>以下是您的朋友【<%=Trim(ReadRS.Fields.Item("SenderEmail").Value)%>】给您的信息</p>
<p><textarea cols='88' rows='10' class='TDBG' readonly><%=txt%></textarea></p>
<p><b>允许阅读时限为:</b><%=Trim(ReadRS.Fields.Item("ReadTimeStart").Value)%> 到 <%=Trim(ReadRS.Fields.Item("ReadTimeClose").Value)%> 之间</p>
<p><b>剩余阅读次数:</b><%=ReadRS.Fields.Item("ReadNumber").Value-1%> 次 <label id="show">当前时间正在载入……</label> <label id="showLeft">剩余时间正在载入……</label></p>
<%
if (ReadRS.Fields.Item("ReadNumber").Value) > "0" Then'当剩余阅读次数大于0开始
'更新阅读次数开始
RN = (ReadRS.Fields.Item("ReadNumber").Value)
Key = (ReadRS.Fields.Item("ReadKey").Value)
Function MM_IIf(condition, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_CONN_STRING
MM_editCmd.CommandText = "UPDATE [NoteTable] SET ReadNumber = ? WHERE ReadKey = ?"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 5, 1, -1, MM_IIF((RN-1), (RN-1), null)) ' adDouble
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 200, 1, 32, Key) ' adVarChar
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
'更新阅读次数结束
'阅读发信通知发送者开始
toemail = (ReadRS.Fields.Item("SenderEmail").Value) '邮件将发送的地址
set jmail = server.createobject("jmail.message") '创建组件
jmail.silent = true '开启错误码
jmail.logging = true '打开日记访问
jmail.charset = "gb2312" '邮件编码
jmail.contentType = "text/html" '邮件格式(HTML:text/html)
jmail.addrecipient toemail '邮件发送地址
jmail.from = fromemail '发送邮件者地址
jmail.FromName = ""&sysName&"特快专递"
jmail.subject = ""&sysName&"信息已被阅读通知邮件" '邮件标题
'获取系统安装路径开始
k=split("" & Request.ServerVariables("PATH_INFO") & "","/")
n=ubound(k)
FileName=k(n)
menu = replace(Request.ServerVariables("PATH_INFO"),FileName,"")
host = Request.ServerVariables("Http_Host")
URL = "http://"&host&menu
'Response.Write URL
'获取系统安装路径结束
jmail.body = "<p>您要求在 "&(ReadRS.Fields.Item("ReadTimeStart").Value)&" 到 "&(ReadRS.Fields.Item("ReadTimeClose").Value)&" 之间阅读的私密信息,您的朋友:"&(ReadRS.Fields.Item("ReaderEmail").Value)&" 已经在 "&Now()&" 阅读了1次。</p><p>此信息允许阅读次数剩余 "&(ReadRS.Fields.Item("ReadNumber").Value-1)&" 次。</p><br /><p>(提醒:本邮件为系统自动发送 请勿回复 谢谢!) <br /><br />本邮件发出时系统时间为:["&NowTime&"] </p>" '邮件内容
jmail.mailserverusername = username '登录邮件服务器用户名
jmail.mailserverpassword = pass '登录邮件服务器密码
jmail.priority = 3 '优先级(1-5)5为最高
jmail.send(servername) '邮件发送
set jmail = nothing '关闭对象
'阅读发信通知发送者结束
if (ReadRS.Fields.Item("ReadNumber").Value-1) < 1 Then'判断允许阅读次数在本次阅读后是否应该删除开始
'销毁发信通知发送者开始
toemail = (ReadRS.Fields.Item("SenderEmail").Value) '邮件将发送的地址
set jmail = server.createobject("jmail.message") '创建组件
jmail.silent = true '开启错误码
jmail.logging = true '打开日记访问
jmail.charset = "gb2312" '邮件编码
jmail.contentType = "text/html" '邮件格式(HTML:text/html)
jmail.addrecipient toemail '邮件发送地址
jmail.from = fromemail '发送邮件者地址
jmail.FromName = ""&sysName&"特快专递"
jmail.subject = ""&sysName&"信息已被销毁通知邮件" '邮件标题
jmail.body = "<p>您发送给:"&(ReadRS.Fields.Item("ReaderEmail").Value)&" 的私密信息由于超过允许阅读次数,已经在 "&Now()&" 自动销毁。</p><p>(提醒:本邮件为系统自动发送 请勿回复 谢谢!) <br /><br />本邮件发出时系统时间为:["&NowTime&"] </p>" '邮件内容
jmail.mailserverusername = username '登录邮件服务器用户名
jmail.mailserverpassword = pass '登录邮件服务器密码
jmail.priority = 3 '优先级(1-5)5为最高
jmail.send(servername) '邮件发送
set jmail = nothing '关闭对象
'销毁发信通知发送者结束
'销毁发信通知阅读者开始
toemail = (ReadRS.Fields.Item("ReaderEmail").Value) '邮件将发送的地址
set jmail = server.createobject("jmail.message") '创建组件
jmail.silent = true '开启错误码
jmail.logging = true '打开日记访问
jmail.charset = "gb2312" '邮件编码
jmail.contentType = "text/html" '邮件格式(HTML:text/html)
jmail.addrecipient toemail '邮件发送地址
jmail.from = fromemail '发送邮件者地址
jmail.FromName = ""&sysName&"特快专递"
jmail.subject = ""&sysName&"信息已被销毁通知邮件" '邮件标题
jmail.body = "<p>您的朋友:"&(ReadRS.Fields.Item("SenderEmail").Value)&" 发送给您的私密信息由于超过允许阅读次数,已经在 "&Now()&" 自动销毁。</p><p>(提醒:本邮件为系统自动发送 请勿回复 谢谢!) <br /><br />本邮件发出时系统时间为:["&NowTime&"] </p>" '邮件内容
jmail.mailserverusername = username '登录邮件服务器用户名
jmail.mailserverpassword = pass '登录邮件服务器密码
jmail.priority = 3 '优先级(1-5)5为最高
jmail.send(servername) '邮件发送
set jmail = nothing '关闭对象
'销毁发信通知阅读者结束
'删除信息记录开始
DelKey = (ReadRS.Fields.Item("ReadKey").Value)
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_CONN_STRING
MM_editCmd.CommandText = "DELETE FROM [NoteTable] WHERE ReadKey = ?"
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 200, 1, 32, DelKey) ' adDouble
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
'删除信息记录结束
End if'判断允许阅读次数在本次阅读后是否应该删除结束
End if'当剩余阅读次数大于0结束
%>
<% End If ' end Not ReadRS.EOF Or NOT ReadRS.BOF 不为空%>
<%If ReadRS.EOF And ReadRS.BOF Then'为空
Response.Redirect("Error.asp?ErrorInfo=阅读密钥错误!或信息已被销毁!")
End If ' end ReadRS.EOF And ReadRS.BOF 为空%>
<%
ReadRS.Close()
Set ReadRS = Nothing
%>
<%Else'判断阅读密钥不为空中间%>
<p> </p>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr><form id="form1" name="form1" method="post" action="">
<td align="right">请输入阅读密钥:<input type="hidden" name="key" value="<%=Request("key")%>"></td>
<td width="70" align="center"><input name="ReadPassW" type="text" class="TDBG" id="ReadPassW" size="10" /></td>
<td align="left">
<input name="Submit" type="submit" class="TDBG" value="确定" /> </td>
</form></tr>
</table>
<p> </p>
<%End if'判断阅读密钥不为空结束%>
<!--#include file="Inc/foot.asp" -->
<%Else'判断是否来自index.asp中间%>
<center><font color="#FF0000">请勿尝试非法访问!</font></Center>
<%End if'判断是否来自index.asp结束%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -