ASP 에서 자동 채집 프로그램 및 입고 코드 구현
2775 단어 ASP 에서 자동 채집 프로그램 및 입고 코드 구현
<%
' , XML 。
Geturl(/blog/url)
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
Open "GET", url, False
Send
GetURL = bytes2bstr(.responsebody)
' , 100
if len(.responsebody)<100 then
response.write " <a href="/blog/"&url&" target=_blank>"&url&"</a> 。"
response.end
end if
End With
Set Retrieval = Nothing
End
' , !
bytes2bstr(vin)
strreturn = ""
for i = 1 to lenb(vin)
thischarcode = ascb(midb(vin,i,1))
if thischarcode < &h80 then
strreturn = strreturn & chr(thischarcode)
else
nextcharcode = ascb(midb(vin,i+1,1))
strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint(nextcharcode))
i = i + 1
end if
next
bytes2bstr = strreturn
end
' , Start , Last
GetKey(HTML,Start,Last)
filearray=split(HTML,Start)
filearray2=split(filearray(1),Last)
GetKey=filearray2(0)
End
Dim Softid,Url,Html,Title
' ID
SoftId=Request("Id")
Url="http://www3.skycn.com/soft/"&SoftId&".html"
Html = Geturl(/blog/Url)
'
Title = GetKey(Html,"<font color='#004FC6' size='3'>","</font></b></td></tr>")
' ,
dim connstr,conn,rs,sql
connstr="DBQ="+server.mappath("db1.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
set rs=server.createobject("adodb.recordset")
sql="select [ ] from [ ] where [ ]='"&Title&"'"
rs.open sql,conn,3,3
if rs.eof and rs.bof then
rs(" ")=Title
rs.update
set rs=nothing
end if
set rs=nothing
Response.Write" !"
%>