?? collectstart.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
option explicit
Response.Buffer = True
Server.ScriptTimeOut=10
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="inc/clsCache.asp"-->
<%
Dim ProjectID
Dim FoundErr,ErrMsg
Dim SqlProject,RsProject
Dim Arr_Project,Arr_Histroy,ProjectCache
Dim CacheTemp
FoundErr=False
CacheTemp=Lcase(trim(request.ServerVariables("SCRIPT_NAME")))
CacheTemp=left(CacheTemp,instrrev(CacheTemp,"/"))
CacheTemp=replace(CacheTemp,"\","_")
CacheTemp=replace(CacheTemp,"/","_")
CacheTemp="trsoft" & CacheTemp
ProjectID=Request.QueryString("ProjectID")
if ProjectID="" then
FoundErr=True
ErrMsg=ErrMsg &"<br>項目編號錯誤!"
end if
if FoundErr<>True then
Call SetCache()
If FoundErr<>True Then
Session("ListNum")=1
Session("InfoSuccessNum")=0
Session("InfoFalseNum")=0
Session("ArticleID")=0
ErrMsg="<meta http-equiv=""refresh"" content=""3;url=collectinfo.asp"">"
end If
end If
if FoundErr=True then
Call WriteErrMsg(ErrMsg)
else
Call Main()
end If
'關閉數據庫鏈接
Call CloseConn()
Call CloseConnHistroy()
Sub SetCache()
'項目信息
SqlProject ="select * from Project where ProjectID ="&ProjectID
Set RsProject=Server.CreateObject("adodb.recordset")
RsProject.Open SqlProject,ConnHistroy,1,1
If Not RsProject.Eof Then
Arr_Project=RsProject.GetRows()
End If
RsProject.Close
Set RsProject=Nothing
Set ProjectCache=new clsCache
ProjectCache.name=CacheTemp & "Project"
Call ProjectCache.clean()
If IsArray(Arr_Project)=True Then
ProjectCache.add Arr_Project,Dateadd("n",1000,now)
Else
FoundErr=True
ErrMsg=ErrMsg & "<br>發生意外錯誤!"
End If
'歷史記錄
SqlProject ="select NewsUrl,Title,CollectionTime,Result from Histroy"
Set RsProject=Server.CreateObject("adodb.recordset")
RsProject.Open SqlProject,ConnHistroy,1,1
If Not RsProject.Eof Then
Arr_Histroy=RsProject.GetRows()
End If
RsProject.Close
Set RsProject=Nothing
ProjectCache.name=CacheTemp & "histroy"
Call ProjectCache.clean()
If IsArray(Arr_Histroy)=True Then
ProjectCache.add Arr_Histroy,Dateadd("n",1000,now)
End If
set ProjectCache=nothing
End Sub
Sub Main
%>
<html>
<head>
<title>通用信息采集系統</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/style.css">
<style type="text/css">
<!--
.STYLE1 {
color: #000000;
font-weight: bold;
}
.STYLE2 {color: #FF0000}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder">
<tr>
<th height="22" colspan="2" align="center"><span class="STYLE1">采 集 項 目 管 理</span></th>
</tr>
</table>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder">
<tr>
<td width="65" height="30"><strong>管理導航:</strong></td>
<td height="30"><a href="collectionmanage.asp">管理首頁</a> >> 新聞采集 >> 初始化數據</td>
</tr>
</table>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder" >
<tr>
<td height="100" colspan="2" align=center>
<br>
歡迎使用通用信息采集系統,正在初始化數據,請稍后...
<br><br>
<%=ErrMsg%>
</td>
</tr>
</table>
</body>
</html>
<%End Sub%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -