⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 update.asp

📁 本系统是在“阿江酷站统计系统”的基础上改写而成
💻 ASP
字号:
<%@ CODEPAGE = "936" %>
<!--#include file="inc_config.asp"-->
<!--#include file="inc_menu.asp"-->

<%

'****************** 创建数据对象 ******************
set conn=server.createobject("adodb.connection")

conn.Open constr
Set rs = Server.CreateObject("ADODB.Recordset")

set connip=server.createobject("adodb.connection")

connip.Open constr
Set rsip = Server.CreateObject("ADODB.Recordset")


if Request("type")="go" then

tall=clng(Request("tall"))
'如果有“启动”标记,则创建up_date字段并全部标记为未更新。
if Request("start")="yes" then
	'on error resume next
	sql="select count(*) as tall from views where mem_id = "& uid &" and vwhere='N/A'"
	temprs=conn.Execute(sql)
	tall=temprs("tall")
	set temprs=nothing

	sql="ALTER TABLE views ADD COLUMN up_date bit"
	conn.execute(sql)

	sql="update views set up_date=0"
	conn.execute(sql)
elseif tall=0 then
	sql="select count(*) as tall from views where mem_id = "& uid &" and  vwhere='N/A' and up_date=0"
	temprs=conn.Execute(sql)
	tall=temprs("tall")
	set temprs=nothing
end if

'****************** 更新主数据库 ******************
	on error resume next

	sql="select top 50 * from views where  mem_id = "& uid &" and vwhere='N/A' and up_date=0"
	rs.Open sql,conn,3,2
	if rs.EOF then
	rs.Close
	sql="ALTER TABLE views drop up_date"
	conn.execute(sql)
	Response.Write "完成"
	else

	do while not rs.EOF
	rs("vwhere")=cadd(rs("vip"))
	rs("up_date")=1
	rs.Update
	rs.MoveNext
	loop
	rs.Close

	sql="select count(*) as thavenot from views where  mem_id = "& uid &" and vwhere='N/A' and up_date=0"
	temprs=conn.Execute(sql)
	thavenot=temprs("thavenot")
	thave=tall-thavenot
	ttlong=int(thave*300/tall)

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=countname%>-更新主数据库</title>
<LINK rel="stylesheet" type="text/css" href="style.css">
<meta http-equiv="refresh" content="1; url='update.asp?type=go&tall=<%=tall%>'">
</head>
<body>
<center>
    <br>更 新 进 度<br><br>
<table width="304" cellspacing="1" align="center" cellpadding="0" border="0" class=backs>
  <tr>
    <td align=center>
<table width="300" cellspacing="1" align="center" cellpadding="0" border="0" class=backq>
  <tr height=15>
    <td align=center width="<%=ttlong%>" class=backs>
	</td>
    <td align=center width="<%=300-ttlong%>" bgcolor=white>
	</td>
  </tr>
</table>
	</td>
  </tr>
</table>
<br>已更新/所有: <font class=fonts><%=thave%></font>/<%=tall%>
<br>
如果程序没有继续进行,请点击→[<a href=update.asp?type=go&tall=<%=tall%>>继续</a>]
<br>如果要暂停这一次更新,请点击→[<a href="master.asp">暂停</a>]
<br><br>登录进入更新页面,点击“继续上次未完成的更新”即可继续本次更新。
</center>
</body>
</html>
<%
end if


else	'如果type<>go
%>
本页功能是用新的IP库更新主记录库,请从管理员页面进入,误闯无罪。

<%
end if

'****************** 关闭数据对象 ******************
set rs=nothing
conn.Close
set conn=nothing

set rsip=nothing
connip.Close
set connip=nothing

'****************** 自定义函数 ********************
function cadd(sip)
	ipnow=cip(sip)

	sql="select * from ip where (onip<=" & ipnow & " and offip>=" & ipnow & ")"
	rsip.Open sql,connip,1,1

	if rsip.EOF then
	  cadd="N/A"
	else
	  cadd=rsip("addj")
	end if
	rsip.Close
end function

function cip(sip)
	tip=cstr(sip)
	sip1=left(tip,clng(instr(tip,".")-1))
	tip=mid(tip,clng(instr(tip,".")+1))
	sip2=left(tip,clng(instr(tip,".")-1))
	tip=mid(tip,clng(instr(tip,".")+1))
	sip3=left(tip,clng(instr(tip,".")-1))
	sip4=mid(tip,clng(instr(tip,".")+1))
	cip=clng(sip1)*256*256*256+clng(sip2)*256*256+clng(sip3)*256+clng(sip4)
end function

function islast()
	islast=true
	on error resume next
	sql="select * from view where  mem_id = "& uid &" and up_date=0"
	conn.execute(sql)
	if err<>0 then islast=false
end function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -