updateFunction-US.asp
上传用户:rblchem
上传日期:2022-04-27
资源大小:1941k
文件大小:20k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. <script language="JavaScript" runat="server">
  2. function rfc_to_iso(DataRCC){
  3. var dateTimeObject = new Date(DataRCC);
  4. if(isNaN(dateTimeObject)){
  5.    var dateTimeObject2 = new Date(DataRCC.substring(0,DataRCC.lastIndexOf(" ")));
  6.    if (isNaN(dateTimeObject2)){
  7.            return DataRCC;
  8.    }
  9.    else{
  10.    return dateTimeObject2.toUsaString();
  11.            }    
  12. }
  13. else{
  14. return dateTimeObject.toUsaString();
  15. }
  16. }
  17. function ZeroPad(n)
  18. {
  19.         if (n < 10)
  20.                 return "0" + n;
  21.         return n;
  22. }
  23. Date.prototype.toUsaString = function()
  24. {
  25.         return (ZeroPad(this.getMonth() + 1)) + "/" +
  26.                 ZeroPad(this.getDate()) + "/" +
  27.                 ZeroPad(this.getFullYear()) + " " +
  28.                 ZeroPad(this.getHours()) + ":" +
  29.                 ZeroPad(this.getMinutes()) + ":" +
  30.                 ZeroPad(this.getSeconds());
  31. }
  32. </script>
  33. <%
  34. Public ISUserUpdate,BLOGURL
  35. db="../data/"&dbname
  36. %>
  37. <!-- #include file="conn.asp" -->
  38. <!-- #include file="RegExpFunction.asp" -->
  39. <%
  40. IF ISServerScriptTimeout=1 Then
  41. Server.ScriptTimeout=Server_ScriptTimeout
  42. End IF
  43. Function FilterSQL(strSQL)
  44. FilterSQL=CStr(Replace(strSQL,chr(39),chr(39)&chr(39)))
  45. End Function
  46. Function StrangeTOISO(DataRCC)
  47. StrangeTOISO=ReplaceStr(DataRCC,"(?:D*)(d+)D(d+)D(d+)D(d+)D(d+)D(d+)(?:.*)","$1-$2-$3 $4:$5:$6")
  48. End function
  49. Function RegExpTest(patrn, strng)
  50. Dim regEx, retVal 
  51. Set regEx = New RegExp 
  52. regEx.Pattern = patrn  
  53. regEx.IgnoreCase = False  
  54. RegExpTest = regEx.Test(strng) 
  55. End Function
  56. Function GetList(ID)
  57. SET conn=connectDB()
  58.  set rs=server.createobject("adodb.recordset")
  59.  If ID=1 Then
  60.  sql="select * from [linkxml] where Category_id="&Request.QueryString("id")&" and Shenhe=1"
  61.  End IF
  62.  If ID=2 Then
  63.  sql="select * from [linkxml] where Shenhe=1"
  64.  End IF
  65.  rs.open sql,conn,1,3 
  66.  for i=1 to rs.recordcount
  67.  List=List&rs(0)&"|"
  68.  rs.movenext
  69.  Next
  70.  rs.close:set rs=nothing
  71.  closedb(conn)
  72.  GetList=List
  73. End Function
  74. Function ListReport(ID)
  75.              List=GetList(ID)
  76.  If trim(list)="" then exit function
  77.  session(SessionStr&"UpDateListByCategory")=List
  78.  List2=split(List,"|")
  79.  session(SessionStr&"ListTotalNumber")=Ubound(List2)
  80.  session(SessionStr&"UpdatePercentage")=0
  81.    session(SessionStr&"report")=""
  82.  Response.redirect "update_xml.asp?action=UpdateBySession"
  83. End Function
  84. Function ReplaceStr(source,para,str)
  85.   Set objRegExp=New RegExp
  86.   objRegExp.IgnoreCase =True
  87.   objRegExp.Global=True
  88.   objRegExp.Pattern=para
  89.   ReplaceStr= objRegExp.Replace(source,str)
  90.   Set objRegExp=Nothing
  91. End Function
  92. Function Showerr_Desciption(ErrorID)
  93. Set conn=ConnectDB()
  94. Set RS=conn.execute ("select * from [ErrHandle] where [ErrorID]=" & ErrorID )
  95. If not rs.eof Then
  96. Showerr_Desciption=" 错误代码:"&RS(0)&",错误描述:"&RS(1)&"&nbsp;"&RS(2)
  97. Else
  98. Showerr_Desciption="错误库中没有关于代码为"&ErrorID&"的描述,请向<a href=""http://www.sxna.cn"" target=_blank>www.sxna.cn</a>报告此问题"
  99. End IF
  100. rs.close:set rs=nothing
  101. CloseDB(conn)
  102. End Function
  103. Function Shengcheng(UpdateCatId,XmlId)
  104. Set conn=ConnectDB()
  105. APPLICATION.LOCK
  106. application(SessionStr&"SXNA_NOWTIME") = now()
  107. APPLICATION.UNLOCK
  108. If UpdateCatId<>"" and XmlId="" Then 
  109.     sql="select * from [linkxml] where Category_id="&UpdateCatId&" and Shenhe=1"
  110. Else
  111.     If UpdateCatId="" and XmlId<>"" Then 
  112.     sql="select * from [linkxml] where id="&XmlId&" and Shenhe=1"
  113.     Else
  114. sql="select * from [linkxml] where Shenhe=1"
  115. End If
  116. End If 
  117. set rs=server.createobject("adodb.recordset")
  118.     rs.open sql,conn,1,3 
  119.     DBcount=rs.recordcount
  120. Redim XMLLINK(DBcount)
  121. Redim XMLLINKID(DBcount)
  122. Redim XMLLINKLastUpdateTime(DBcount)
  123. Redim XMLLINKInteval(DBcount)
  124. Redim XMLLINKAggregateNumber(DBcount)
  125. Redim XMLLINKcategory_id(DBcount)
  126. Redim XMLLINKlastupdatetime(DBcount)
  127. Redim XMLLINKElements(DBcount)
  128. Redim XMLLINKHtmlURL(DBcount)
  129. for i = 1 to DBcount
  130. if rs.EOF then     
  131. Exit For 
  132. end if
  133. XMLLINK(i)=rs("linkxml")
  134. XMLLINKID(i)=rs("id")
  135. XMLLINKcategory_id(i)=rs("category_id")
  136. XMLLINKInteval(i)=rs("Inteval")
  137.         XMLLINKAggregateNumber(i)=rs("AggregateNumber")
  138. XMLLINKlastupdatetime(i)=rs("lastupdatetime")
  139. XMLLINKElements(i)=rs("Elements")
  140. XMLLINKHtmlURL(i)=rs("htmlUrl")
  141. rs.MoveNext
  142. Next
  143. rs.close:set rs=nothing
  144. CloseDB(conn)
  145. for j=1 to DBcount
  146. call InputXML(XMLLINKcategory_id(j),XMLLINK(j),XMLLINKID(j),XMLLINKInteval(j),XMLLINKAggregateNumber(j),XMLLINKlastupdatetime(j),XMLLINKElements(j),XMLLINKHtmlURL(j))
  147. next
  148. ShengCheng=True
  149. End Function
  150. Function Showerr(msg1,msg2,msg3)
  151. Report=Report& "<tr><td width=""80%"">"&msg1&"</td><td width=""20%"">"&msg2&"</td></tr><tr><td colspan=""2"">"&msg3&"</td></tr>"
  152. End Function
  153. Function InputXML(XLC_ID,RSSLINK_S,RSSLINKID_S,XMLLINKInteval,XMLLINKAggregateNumber,XMLLINKlastupdatetime,XMLLINKElements,XMLLINKHtmlURL)
  154. On Error Resume Next
  155. IF CheckRights2=False then
  156. If DateDiff("n",XMLLINKlastupdatetime,now())<XMLLINKInteval then
  157. Report=Report& "<tr><td width=""80%"">"&RSSLINK_S&"</td><td width=""20%"">未下载</td></tr><tr><td colspan=""2"">允许更新时间未到,上次更新时间是"&XMLLINKlastupdatetime&",允许前台更新时间为"&XMLLINKInteval&"分钟,现在过了"&DateDiff("n",XMLLINKlastupdatetime,now())&"分钟</td></tr>"
  158. Exit Function
  159. End IF
  160. End IF
  161. If isnull(XMLLINKElements) or trim(XMLLINKElements)="" then
  162. Report=Report&"<tr><td width=""80%"">"&RSSLINK_S&"</td><td width=""20%"">未设置元素</td></tr><tr><td colspan=""2"">请进行[重载]或[站点重载],设置提取元素.</td>"
  163. Exit Function
  164. Else
  165. elements=split(XMLLINKElements,"|||")
  166. End if
  167. If IsUseXmlHttp=1 then
  168.             On Error Resume Next
  169. Set http=Server.CreateObject("Microsoft.XMLHTTP")
  170. http.Open "GET",RSSLINK_S,False
  171. If Err Then
  172. Report=Report&"<tr><td colspan=""2"">您的地址有错误.请检查"&Err.Number&Err.description&"</td><tr>"
  173. Err.Clear
  174. set http=nothing
  175. Exit Function
  176. End If
  177. http.send
  178. Else        
  179.             on error resume next
  180.             Dim http
  181. Set http = Server.CreateObject("Msxml2.ServerXMLHTTP")
  182. http.setTimeouts lResolve*1000,lConnect*1000,lSend*1000,lReceive*1000
  183. http.Open "GET",RSSLINK_S,False
  184. http.Send
  185.             'response.write Err.Number&Err.Description&http.readyState
  186. 'response.end
  187. Select Case http.readyState
  188. Case 0
  189. call Showerr("对象初始化失败,估计你输入了一堆无效的字符....","请检查一下~","错误参数:"&Err.Number&Err.Description)
  190. Err.Clear
  191. set http=nothing
  192. Exit Function
  193. Case 1
  194. call Showerr(RSSLINK_S&"域名分析超时/连接站点超时!也许是这个网站有问题,或许是超时设定太短,或许机器没有联网","请检查","错误参数:"&Err.Number&Err.Description)
  195. Err.Clear
  196. set http=nothing
  197. Exit Function
  198. Case 2
  199. call Showerr(RSSLINK_S&"发送数据请求超时,是不是服务器出故障了?","请检查","错误参数:"&Err.Number&Err.Description)
  200. Err.Clear
  201. set http=nothing
  202. Exit Function
  203. Case 3
  204. ContentLength=http.GetResponseHeader("Content-Length")
  205. If err.number=-2147012746 then
  206. Call Showerr(RSSLINK_S&"数据下载超时/等待反馈时间超时","原因如下","没有获得文件大小的信息,估计网站有问题,可能是你的等待反馈时间超时设定太短")
  207. Else
  208.     Call Showerr(RSSLINK_S&"数据下载超时/等待反馈时间超时","原因如下","该文件大小"&Formatnumber(ContentLength/1000,2)&"KB,下载过程中超过你设定的等待反馈时间超时时间,可能是你的等待反馈时间超时设定太短了,或许这个网站他就是慢...")
  209. End If
  210. Err.Clear
  211. set http=nothing
  212. Exit Function
  213. Case 4
  214.     ErrContentLength=0
  215. ContentLength=http.GetResponseHeader("Content-Length")
  216. If err.number=-2147012746 then
  217. If http.Status=200 Then
  218. ErrContentLength=1   
  219. End If
  220. Err.clear
  221. ElseIf err.number<>0 then
  222. call Showerr(RSSLINK_S&"有未知错误发生","有错误","错误参数:"&Err.Number&Err.Description)
  223. Err.Clear
  224. set http=nothing
  225. Exit Function
  226. Else
  227. End If
  228. End Select
  229. End If
  230. If http.status<>200  then
  231. Report=Report& "<tr><td width=""80%"">"&RSSLINK_S&"</td><td width=""20%"">下载失败,描述如下</td></tr><tr><td colspan=""2"">"&Showerr_Desciption(http.status)&"</td></tr>"
  232. Err.Clear
  233. set http=nothing
  234. Exit Function
  235. END IF
  236. If http.status="200" then'1
  237.     If ErrContentLength=1 then
  238. Report=Report& "<tr><td width=""80%"">"&RSSLINK_S&"(没找到文件长度信息)</td><td width=""20%"">下载成功</td></tr>"
  239. Else
  240. Report=Report& "<tr><td width=""80%"">"&RSSLINK_S&"</td><td width=""20%"">下载成功</td></tr>"
  241. End If
  242. Set xml=Server.CreateObject("Microsoft.XMLDOM")
  243. xml.Async=False
  244. xml.ValidateOnParse=False
  245. xml.Load(http.ResponseBody)
  246. Set http=Nothing
  247. If xml.ReadyState=4 Then'2
  248. If xml.parseError.errorCode <> 0 Then'3
  249. Report=Report& "<tr><td colspan=""2"">解析失败,此文件不是XML文件</td></tr>"
  250. set xml=nothing
  251. Exit Function
  252. Else
  253.        '获取链接
  254. If elements(0)="RSS" then
  255.    Set channel=xml.documentElement.selectSingleNode("channel")
  256.    Set item=xml.getElementsByTagName("item")
  257. Else' elements(0)="Atom" then
  258.    Set channel=xml.getElementsByTagName("feed")
  259.    set channel=channel(0)
  260.    Set item=xml.getElementsByTagName("entry")
  261. End if'If elements(0)="rss"
  262.     Rs_link2=XMLLINKHtmlURL
  263. BLOGURL=XMLLINKHtmlURL
  264.   If ((XMLLINKAggregateNumber)>(item.Length)) then
  265. ItemNum=item.Length
  266.    Else
  267. ItemNum=XMLLINKAggregateNumber
  268.   End if
  269. redim RS_title(ItemNum)
  270. redim RS_Author(ItemNum)
  271. redim RS_pubDate(ItemNum)
  272. redim RS_link(ItemNum)
  273. redim RS_Description(ItemNum)
  274. For i=0 To ItemNum-1
  275. If elements(0)="RSS" then
  276. '链接获取
  277. RS_link(i)=item(i).selectSingleNode(elements(9)).text
  278. '作者获取
  279. If elements(2)="Multi" then
  280.     RS_Author(i)=item(i).selectSingleNode(elements(3)).text
  281. If elements(14)="0" Then
  282. RS_Author(i)=RegExpHtml(RS_Author(i),RegExpType_Author)
  283. Else
  284. RS_Author(i)=RegExpHtml(RS_Author(i),elements(14))
  285. End IF
  286. Else
  287. RS_Author(i)=elements(4)
  288. End if
  289. Else
  290. '链接获取
  291. RS_link(i)=item(i).selectSingleNode(elements(9)).getAttributeNode("href").value
  292. '作者获取
  293. If elements(2)="Multi" then
  294. RS_Author(i)=item(i).selectSingleNode("author").selectSingleNode(elements(3)).text
  295. If elements(14)="0" Then
  296. RS_Author(i)=RegExpHtml(RS_Author(i),RegExpType_Author)
  297. Else
  298. RS_Author(i)=RegExpHtml(RS_Author(i),elements(14))
  299. End IF
  300. Else
  301. RS_Author(i)=elements(4)
  302. End if
  303. End IF
  304. '标题获取
  305. RS_title(i)=item(i).selectSingleNode(elements(1)).text
  306. If elements(13)="0" Then
  307.                 RS_title(i)=RegExpHtml(RS_title(i),RegExpType_Title)
  308. Else
  309. RS_title(i)=RegExpHtml(RS_title(i),elements(13))
  310.                 End If
  311. If isIntercept_title=1 then
  312. RS_title(i)=Left(RS_title(i),InterceptTitle)
  313. Else
  314. RS_title(i)=RS_title(i)
  315. End If
  316. '时间获取
  317. set pubDate=item(i).selectSingleNode(elements(5))
  318. If pubdate is nothing then
  319. Report=Report& "<tr><td colspan=""2"">时间设置有错误,老兄若实在搞不定,请提交"&RSSLINK_S&"到<A HREF=""http://www.sxna.cn"" target=""_blank"">SXNA交流论坛</A></tr></td>"
  320. Exit function
  321. set xml=nothing
  322. Else
  323. If elements(6)="Type1" then
  324. RS_pubDate(i)=StrangeTOISO(pubdate.text)
  325. End IF
  326. If elements(6)="Type2" then
  327. RS_pubDate(i)=rfc_to_iso(pubdate.text)
  328. End IF
  329. If elements(6)="Type3" then
  330. RS_pubDate(i)=ReplaceStr(pubdate.text,elements(7),elements(8))
  331. End IF
  332. End IF
  333.                     RS_Description(i)=item(i).selectSingleNode(elements(10)).text
  334. If DisplayDescriptionType=1 then
  335. RS_Description(i)=RS_Description(i)
  336. Else
  337.     '先判断转化模式
  338. If Elements(11)="0" Then
  339. '应用全局设定转化模式
  340. RS_Description(i)=RegExpHtml(RS_Description(i),RegExpType_Discription)
  341. Else
  342. '应用特定转化模式
  343. RS_Description(i)=RegExpHtml(RS_Description(i),Elements(11))
  344. End If
  345. '截取字符
  346. If Elements(12)="" Then
  347. '应用全局设定截取字符
  348. IF isIntercept_description=0 then
  349. RS_Description(i)=RS_Description(i)
  350. Else
  351. RS_Description(i)=Left(RS_Description(i),cint(InterceptDescriptin))
  352. End If
  353. Else
  354. '应用特定截取字符
  355. RS_Description(i)=Left(RS_Description(i),cint(Elements(12)))
  356. End If
  357. End IF
  358. RS_title(i)=EncodeJP(RS_title(i))
  359. RS_Description(i)=EncodeJP(RS_Description(i))
  360. Next
  361. SuccessFlag=1
  362.       End If ' 3 parseError.errorCode <> 0
  363. Else'2 
  364. Report=Report&"文档还未准备就绪。状态:"& xml.ReadyState &"<br>"
  365.     End If '2 xml ReadyState2
  366. End if '1 下载成功
  367. Set xml=Nothing
  368. If SuccessFlag=1 Then
  369. 'on error resume next
  370.     
  371.     Report=Report& "<tr><td colspan=""2"">解析完成,"
  372. Set CONN=ConnectDB()
  373.     If IsStoreArticle=0 then
  374. CONN.execute "delete * from Article where xmlid="&RSSLINKID_S
  375. End If
  376.     '初始化计数器
  377.     SuccessNumber=0
  378. '成功存入的数目
  379.     BadFilterNumber=0
  380. '过滤掉的数目
  381. BadFilterNumberButIn=0
  382.     '过滤掉字符但是入库了的数目
  383. OverlapNumber=0
  384. '重复的文章/更新的文章数目
  385. UnKnownErrNumber=0
  386. '未知错误条数
  387. TimeExceed=0
  388. '超前的文章时间
  389. TimeErrNumber=0
  390. '时间错误的文章数(...累死我了)
  391.     
  392.     For i=0 To ItemNum-1
  393.     
  394. If ISDate(RS_pubDate(i)) Then 
  395.     '如果时间条件满足,则放入相应的目录
  396.     IF DateDiff("n",RS_pubDate(i),now())>0 THEN
  397. '不储存利用时间调大的置顶文章
  398.                  RS_pubDate(i)=formatdatetime(RS_pubDate(i),2)&" "&formatdatetime(RS_pubDate(i),4)
  399.     
  400. If badfilter=0 then
  401. CONN.EXECUTE("INSERT INTO [Article] ([title],[author],[link],[pubDate],[description],[xmlid],[Category_id],[site]) VALUES ('"&FilterSQL(RS_title(i))&"','"&FilterSQL(RS_Author(i))&"','"&RS_link(i)&"','"&RS_pubDate(i)&"','"&FilterSQL(RS_Description(i))&"',"&RSSLINKID_S&","&XLC_ID&",'"&Rs_link2&"')")
  402. Else
  403.     If RegExpTest(badfilterWord, RS_title(i)) or RegExpTest(badfilterWord, RS_Description(i)) then
  404.                             '满足过滤
  405.   If badfilterMode="DeleteWord" then
  406.   '入库
  407.   RS_Description(i)=RegExpHtml(RS_Description(i),"[BadFilter]")
  408.   RS_title(i)=RegExpHtml(RS_title(i),"[BadFilter]")
  409.   BadFilterNumberButIn=BadFilterNumberButIn+1
  410. '过滤掉字符但是入库了的数目
  411.   CONN.EXECUTE("INSERT INTO [Article] ([title],[author],[link],[pubDate],[description],[xmlid],[Category_id],[site]) VALUES ('"&FilterSQL(RS_title(i))&"','"&FilterSQL(RS_Author(i))&"','"&RS_link(i)&"','"&RS_pubDate(i)&"','"&FilterSQL(RS_Description(i))&"',"&RSSLINKID_S&","&XLC_ID&",'"&Rs_link2&"')")
  412.   Report=Report&"已过滤字符(已入库):<a href="""&RS_link(i)&"""><b><font color=""#FF0000"">"&RS_title(i)&"</font></b></a><br />"
  413.   Else
  414.   '不入库
  415.   Report=Report&"已过滤(未入库):<a href="""&RS_link(i)&"""><b><font color=""#FF0000"">"&RS_title(i)&"</font></b></a><br />"
  416.   BadFilterNumber=BadFilterNumber+1
  417.   End If
  418. Else
  419. '不满足过滤
  420. CONN.EXECUTE("INSERT INTO [Article] ([title],[author],[link],[pubDate],[description],[xmlid],[Category_id],[site]) VALUES ('"&FilterSQL(RS_title(i))&"','"&FilterSQL(RS_Author(i))&"','"&RS_link(i)&"','"&RS_pubDate(i)&"','"&FilterSQL(RS_Description(i))&"',"&RSSLINKID_S&","&XLC_ID&",'"&Rs_link2&"')")
  421. End If
  422. End If
  423. If Err.number=-2147467259 Then
  424. 'Report=Report& "<a href="""&RS_link(i)&""" target=""_blank"" style=""color:red;"">"&RS_title(i)&"</a> &nbsp;有重复,未被记入<br>"
  425. err.clear
  426. CONN.EXECUTE("UPDATE [Article] set [title]='"&FilterSQL(RS_title(i))&"',[author]='"&FilterSQL(RS_Author(i))&"',[link]='"&RS_link(i)&"',[pubDate]='"&RS_pubDate(i)&"',[description]='"&FilterSQL(RS_Description(i))&"',[xmlid]="&RSSLINKID_S&",[Category_id]="&XLC_ID&",[site]='"&Rs_link2&"' WHERE [link]='"&RS_link(i)&"' ")
  427. If Err.number<>0 Then
  428. Report=Report& "错误!"&RS_link(i)&Err.number&err.description
  429. err.clear
  430. UnKnownErrNumber=UnKnownErrNumber+1
  431. Else
  432. OverlapNumber=OverlapNumber+1
  433. End If
  434. Else
  435.    If Err.number<>0 Then
  436.    Report=Report& "产生未知错误:"&RS_link(i)&Err.number&err.description&"请向www.sxna.cn报告"
  437.    err.clear
  438.    UnKnownErrNumber=UnKnownErrNumber+1
  439.    End IF
  440. End IF
  441. Else
  442. '由于时间制定而导致未被计入的不进行提示
  443. 'Report=Report&RS_title(i)&"的时间大于当前时间未被计入"
  444. TimeExceed=TimeExceed+1
  445. END IF 'IF RS_pubDate(i)<NOW() THEN 不储存利用时间调大的置顶文章
  446. Else
  447. '如果时间条件不满足
  448. TimeErrNumber=TimeErrNumber+1
  449. 'call ShowErr1(RS_title(i)&"时间"&RS_pubDate(i))
  450. End If 'If ISDate(RS_pubDate(i)) Then'如果时间条件不满足
  451. NEXT
  452. Report=Report& "要求存取"&ItemNum&"条记录"
  453.     
  454. If badfilter=1 then
  455. If BadFilterNumber<>0 then Report=Report&",过滤掉"&BadFilterNumber&"条"
  456. If BadFilterNumberButIn<>0 then Report=Report&",有"&BadFilterNumberButIn&"条中的字符被过滤掉"
  457. End If
  458.  
  459. If IsStoreArticle=1 then
  460. If (ItemNum-OverlapNumber-BadFilterNumber)<>0 then Report=Report&",有"&(ItemNum-OverlapNumber-BadFilterNumber)&"条新信息"
  461. Else
  462. If OverlapNumber<>0 then Report=Report&",有"&OverlapNumber&"条重复未计入"
  463. End If
  464. If TimeErrNumber<>0 then Report=Report&",有"&TimeErrNumber&"条时间错误未计入"
  465. If TimeExceed<>0 then Report=Report&",有"&TimeExceed&"条时间超前未计入"
  466.         
  467. If IsStoreArticle=1 then
  468. If (ItemNum-BadFilterNumber-OverlapNumber-TimeExceed-TimeErrNumber)=0 then
  469.             Report=Report& ",成功更新"&OverlapNumber&"条,没有新信息。"
  470. Else
  471. Report=Report& ",成功更新"&OverlapNumber&"条,成功存入"&(ItemNum-BadFilterNumber-OverlapNumber-TimeExceed-TimeErrNumber)&"条新信息"
  472. End If
  473. Else
  474. Report=Report& ",成功存入"&(ItemNum-BadFilterNumber-OverlapNumber-TimeExceed-TimeErrNumber)&"条。"
  475. End If
  476. Report=Report& "</td></tr>"
  477.     
  478. conn.Execute("UPDATE [linkxml] SET [lastupdatetime] = Now() WHERE [id] ="&RSSLINKID_S)
  479.     
  480. CloseDB(conn)
  481. Application.Lock
  482. Application(SessionStr&"Catelog")=empty
  483. Application(SessionStr&"Statistics")=empty
  484. Application(SessionStr&"SXNAindex")=empty
  485.         Application(SessionStr&"SXNAintPageCount")=empty
  486. Application.unlock
  487. End if
  488. End Function
  489. Public Function EncodeJP(StrHTML)
  490.     If StrHTML<>"" Then
  491.         StrHTML=Replace(StrHTML,"ガ","&#12460;")
  492.         StrHTML=Replace(StrHTML,"ギ","&#12462;")
  493.         StrHTML=Replace(StrHTML,"ア","&#12450;")
  494.         StrHTML=Replace(StrHTML,"ゲ","&#12466;")
  495.         StrHTML=Replace(StrHTML,"ゴ","&#12468;")
  496.         StrHTML=Replace(StrHTML,"ザ","&#12470;")
  497.         StrHTML=Replace(StrHTML,"ジ","&#12472;")
  498.         StrHTML=Replace(StrHTML,"ズ","&#12474;")
  499.         StrHTML=Replace(StrHTML,"ゼ","&#12476;")
  500.         StrHTML=Replace(StrHTML,"ゾ","&#12478;")
  501.         StrHTML=Replace(StrHTML,"ダ","&#12480;")
  502.         StrHTML=Replace(StrHTML,"ヂ","&#12482;")
  503.         StrHTML=Replace(StrHTML,"ヅ","&#12485;")
  504.         StrHTML=Replace(StrHTML,"デ","&#12487;")
  505.         StrHTML=Replace(StrHTML,"ド","&#12489;")
  506.         StrHTML=Replace(StrHTML,"バ","&#12496;")
  507.         StrHTML=Replace(StrHTML,"パ","&#12497;")
  508.         StrHTML=Replace(StrHTML,"ビ","&#12499;")
  509.         StrHTML=Replace(StrHTML,"ピ","&#12500;")
  510.         StrHTML=Replace(StrHTML,"ブ","&#12502;")
  511.         StrHTML=Replace(StrHTML,"ブ","&#12502;")
  512.         StrHTML=Replace(StrHTML,"プ","&#12503;")
  513.         StrHTML=Replace(StrHTML,"ベ","&#12505;")
  514.         StrHTML=Replace(StrHTML,"ペ","&#12506;")
  515.         StrHTML=Replace(StrHTML,"ボ","&#12508;")
  516.         StrHTML=Replace(StrHTML,"ポ","&#12509;")
  517.         StrHTML=Replace(StrHTML,"ヴ","&#12532;")
  518.     End If
  519.     EncodeJP=StrHTML
  520. End Function
  521. %>