網頁截取代碼!

<%@LANGUAGE="VBSCRIPT" CODEPAGE="950"%>
<% Option Explicit %>
<%
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
 dim conn
 dim connStr
 dim Db
 Set conn = Server.CreateObject("ADODB.Connection")
 Db = "db.mdb"
 ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(Db)
 conn.open ConnStr
 dim sql
 dim rs
 set rs=server.createobject("adodb.recordset")
 dim Scheckid
 dim Echeckid
 dim theID
 dim getDomain '取得域名
 dim url,oSend,SourceCode,strReturn,i,ThisCharCode,WhereNS,allLen,WhereNic,get1Nic,WhereBr,getNs2
 dim get2Nic,WhereNs1,WhereNs2,getNs1,Lenget2Nic
 Scheckid=Request("Sid")
 Echeckid=Request("Eid")
for theID=Scheckid to Echeckid
 sql="select TDomain from Sheet1 where id="&theID&" "
 rs.open sql,conn,1,1
 getDomain=rs("TDomain")
' Response.write getDomain &"<br>"
 rs.close
 
url="http://domain.theplanet.net/cgi-bin/domain/lookup/record_lookup.pl?recordtype=A&recordname="&getDomain&"&optionaldns=203.135.128.1"
set oSend=createobject("Microsoft.XMLHTTP")
SourceCode = oSend.open ("GET",url,false)
oSend.send()
SourceCode = bytes2BSTR(oSend.responseBody)

rem 取得NS
WhereNS=Instr(SourceCode,"AUTHORITY SECTION")
allLen=Len(SourceCode)
get1Nic=Right(SourceCode,allLen-WhereNS-17)
WhereBr=Instr(get1Nic,"ADDITIONAL SECTION")
if WhereBr<>0 then
get2Nic=Left(get1Nic,WhereBr-6)
Lenget2Nic=Len(get2Nic)
WhereNs1=Instr(get2Nic,"ns1")

WhereNs2=Instr(get2Nic,"ns2")
getNs2=Right(get2Nic,Lenget2Nic-WhereNs2+1)
end if

sql="update Sheet1 set 2ns='"&getNs2&"' where id="&theID&" "
conn.Execute(sql)

next
set rs=nothing                                                                
conn.close                                                                
set conn=nothing
Set oSend=nothing
%>
<script>
function gotoCheck()
{
 window.open("gethtml-ns.asp?sid=<%=Scheckid+50%>&eid=<%=Echeckid+50%>","_top");
}
gotoCheck();
</script>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章