Response.Write("<head><style><!--span{ font-size: 9pt }--></style></head>")
On Error Resume Next
Dim thisurl,thistext
thisurl=Request("thisurl") '定義文件地址(非Html格式文檔)!
if thisurl="" then
Response.Write("<span>請先輸入文件地址!</span>")
Response.End
End if
Function objxmlhttp(XMLurl)
On Error Resume Next
Set objxml = CreateObject("Microsoft.XMLhttp")
objxml.Open "get",XMLurl,false
objXML.setrequestheader "content-type","application/x-www-form-urlencoded"
objXML.send
objxmlhttp = objXML.responsebody
if Err then
Err.Clear
Response.Write("<span>建立連接失敗,文件不存在或網絡有問題!;錯誤原因:"&Err.Description&"!</span>")
Response.End
End if
End Function
'www.knowsky.com
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
thisurl2=Split(thisurl,",")
For Each ii In thisurl2
thistext=bytes2BSTR(objXMLhttp(ii))
if InStr(thistext,"<Html>")<>0 then
Response.Write("<span>"& ii &" <b>×</b></span><br>")
Else
Response.Write("<span>"& ii &" <b>√</b></span><br>")
End if
Next
if Err then
Err.Clear
Response.Write("<span>碰到意外!;錯誤原因:"&Err.Description&"!</span>")
Response.End
End if
%>