📄 addmd5.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="../md5.asp"-->
<%
Server.ScriptTimeOut=300
if request.Cookies("admin")<>"guoxue" and session("administrator")<>"administrator" then
Response.Redirect("index.asp")
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
td { font-size: 12px; line-height: 17px }
body { font-size: 12px; line-height: 17px }
p { margin-top: 1; margin-bottom: 1 }
a:link { text-decoration: none; color: black }
a:visited { text-decoration: none; color: black }
a:active { text-decoration: none }
a:hover { text-decoration: underline; color: red }
-->
</style>
<p>整数值批量增加<input type="button" value="返回列表" name="back" onClick="location.href='edit.asp'"> </p>
<form name="form1" method="post" action="?action=go">
<table width="60%" border="0">
<tr>
<td>基数</td>
<td>
<input type="text" name="xtext" size="12" value="100000">
原始值,比如("100000",在多少上面叠加)</td>
</tr>
<tr>
<td>开始</td>
<td>
<input type="text" name="xmd5" size="12" value="1">
增加开始数,如("1" 就是添加,"100000+1"到"100000+10"这10各数)</td>
</tr>
<tr>
<td> 结束</td>
<td>
<input type="text" name="xmd5text" size="12" value="100">
增加的差值,如("10") (<font color="#FF0000">提醒:差值太大会导致服务器崩溃!</font>)</td>
</tr>
<tr>
<td> </td>
<td>
<input type="submit" name="Submit" value="提交">
</td>
</tr>
</table>
</form>
<p> </p>
<%
if request("action")<>"" then
dim a0,a1,a2,a3
a0=clng(trim(request.form("xtext")))
a1=clng(trim(request.form("xmd5")))
a2=clng(trim(request.form("xmd5text")))
if a1="" or a2="" or a0="" then
response.write "<script language='javascript'>"& Chr(13)
response.write "alert('数据为空');"& Chr(13)
response.write "window.document.location.href='javascript:history.back()';"& Chr(13)
response.write "</script>" & Chr(13)
end if
if a1>a2 then
response.write "<script language='javascript'>"& Chr(13)
response.write "alert('开始值必须小于结束值');"& Chr(13)
response.write "window.document.location.href='javascript:history.back()';"& Chr(13)
response.write "</script>" & Chr(13)
end if
if a2-a1>9999 then
response.write "<script language='javascript'>"& Chr(13)
response.write "alert('差值超过9999了,服务器会死机');"& Chr(13)
response.write "window.document.location.href='javascript:history.back()';"& Chr(13)
response.write "</script>" & Chr(13)
end if
'if IsNumeric(a0)=true and IsNumeric(a1)=true and IsNumeric(a2)=true then
if Is_lng(a0)<>true or Is_lng(a1)<>true or Is_lng(a2)<>true then
response.write "<script language='javascript'>"& Chr(13)
response.write "alert('必须为数字方可');"& Chr(13)
response.write "window.document.location.href='javascript:history.back()';"& Chr(13)
response.write "</script>" & Chr(13)
end if
set rs=server.createobject("adodb.recordset")
sql="select * from md5 where text='"&a0&"'"
rs.open sql,conn,3,1
if not rs.eof then
response.write "<script language='javascript'>"& Chr(13)
response.write "alert('数据库中可能存在此数据');"& Chr(13)
response.write "window.document.location.href='javascript:history.back()';"& Chr(13)
response.write "</script>" & Chr(13)
end if
rs.close
'do while a1<a2+1
for i= a1 to a2
xmd5=a0+i
xmd5text=md5(xmd5)
mi=i
set rs=server.createobject("adodb.recordset")
sql="select * from md5 "
rs.open sql,conn,3,3
set rsr=server.createobject("adodb.recordset")
sqlr="select * from md5 where text='"&xmd5&"'"
rsr.open sqlr,conn,3,1
if rsr.eof then
rs.addnew
rs("text")=xmd5
rs("md5text")=xmd5text
rs.update
else
mi=mi-1
end if
rsr.close
'response.write"<span id=showImport></span><IE:Download ID=""oDownload"" STYLE=""behavior:url(#default#download)"" />"
'response.write "<script>function onDownloadDone(downDate){showImport.innerHTML=downDate}oDownload.startDownload('addmd5.asp?id="&rs("id")&"',onDownloadDone)</script>"
if i mod 10 =0 then
response.write"<br>正在生成:第("&i&")个 剩"&a2-a1-i+1&"个"
end if
next
'a1+1
'loop
rs.close
set conn=nothing
response.write "<br>"&a0+a1&"----"&a0+a2&"中<font color='red'>"&mi&"</font>"
response.write "<font color='green'>数据加入成功!</font>"
end if
function Is_Lng(a_str)
if not isnumeric(a_str) or len(str) > 10 then
Is_Lng = false
exit function
elseif len(str) < 10 then
Is_Lng = true
exit function
end if
if clng(left(a_str , 9)) > 214748367 then
Is_Lng = false
exit function
elseif clng(left(a_str , 9)) = 214748367 and clng(right(a_str , 1)) > 7 then
Is_Lng = false
exit function
else
Is_Lng = true
exit function
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -