<%
'Declare the function for obtaining the target information and implement it through the XML component.
Function geturl (URL)
Set retrieval = Createobject ("Microsoft. XMLHTTP ")
With Retrieval
. Open "get", URL, false
. Send
Geturl = bytes2bstr (. responsebody)
'Verify the obtained information. If the length of the information is smaller than 100, the interception fails.
If Len (. responsebody) <100 then
Response. Write "failed to get the remote file <a href =" & URL & "target = _ blank>" & URL & "</a>. "
Response. End
End if
End
Set retrieval = nothing
End Function
'Binary to string, otherwise garbled!
Function 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 Function
'Specifies the screenshot format, starting from start and ending with last.
Function getkey (HTML, start, last)
Filearray = Split (HTML, start)
Filearray2 = Split (filearray (1), last)
Getkey = filearray2 (0)
End Function
Dim softid, URL, HTML, title
'Get the ID of the page to be retrieved
Softid = request ("ID ")
Url = "http://www3.skycn.com/soft/" & softid & ". html"
Html = geturl (URL)
'Use the software name used to capture the sky as an Example
Title = getkey (HTML, "<font color = '#004fc6 'size = '3'> ", "</font> </B> </TD> </tr> ")
'Open the database and prepare to import data to the database.
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 [column name] from [Table name] Where [column name] = '"& Title &"' "
Rs. open SQL, Conn, 3, 3
If RS. EOF and Rs. bof then
RS ("column name") = title
Rs. UPDA Te
set rs = nothing
end if
set rs = nothing
response. Write "collection is complete! "
%>