1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

asp+2003+iis6 使用小偷或采集会导致IIS假死

本帖由 BoBo2006-03-22 发布。版面名称:主机讨论

  1. BoBo

    BoBo New Member

    注册:
    2005-09-29
    帖子:
    929
    赞:
    0
    补丁打过了,还是一样的

    我把东西采到的数据直接写入了HTML文件里,有时候IIS会假死,数据不大,只是两三个页面

    是程序问题?还是服务器设置问题?
     
  2. Tameway

    Tameway New Member

    注册:
    2005-09-06
    帖子:
    1,286
    赞:
    8
    打过补丁应该问题能够解决,换一套采集程序测试一下
     
  3. BoBo

    BoBo New Member

    注册:
    2005-09-29
    帖子:
    929
    赞:
    0
    程序是自己弄的:cry:

    代码:
    Function GetHttpPage(HttpUrl)
       If IsNull(HttpUrl)=True Or Len(HttpUrl)<18 Or HttpUrl="$False$" Then
          GetHttpPage="$False$"
          Exit Function
       End If
       Dim Http
       Set Http=Server.Createobject("MSXML2.XMLHTTP")
       Http.open "GET",HttpUrl,False
       Http.Send()
       If Http.Readystate<>4 then
          Set Http=Nothing 
          GetHttpPage="$False$"
          Exit function
       End if
       GetHTTPPage=BytesToBstr(Http.ResponseBody,"GB2312")
       Set Http=Nothing
       If Err.number<>0 then
          Err.Clear
       End If
    End Function
    
    
    '报价
    Url="http://bobo.sina.com.cn/search.php?city=020"
    Html=GetHttpPage(Url)
    Html=Replace(Html,Chr(13),"")
    Html=Replace(Html,Chr(10),"")
    
    Set objRegExp = New Regexp
    objRegExp.IgnoreCase = True
    objRegExp.Global = True
    objRegExp.Pattern = "<!-- 报价 begin -->.+?<!-- 报价 end -->"
    Set Matches=objRegExp.Execute(Html)
    For Each Match in Matches 
      BoBo=Replace(Match.Value,"	","")
    Next
    
    Dim objFso,objFile,strFile
    Set objFso=Server.CreateObject("Scripting.FileSystemObject")
    strFile=Server.MapPath("BoBo_1.html")
    Set objFile=objFso.OpenTextFile(strFile,2,True)
    objFile.Write(BoBo)
    objFile.Close
    Set objFile=Nothing
    
    strFile=Server.MapPath("BoBo_2.html")
    Set objFile=objFso.OpenTextFile(strFile,2,True)
    objFile.Write(Date_2)
    objFile.Close
    Set objFile=Nothing