中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

vbs如何實現搜索代理地址

發布時間:2021-10-12 09:32:11 來源:億速云 閱讀:122 作者:小新 欄目:開發技術

這篇文章給大家分享的是有關vbs如何實現搜索代理地址的內容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。

代碼如下:


'1、輸入url目標網頁地址,返回值getHTTPPage是目標網頁的html代碼
function getHTTPPage(url)
dim Http
set Http=CreateObject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
end function

'2、轉換亂瑪,直接用xmlhttp調用有中文字符的網頁得到的將是亂瑪,可以通過adodb.stream組件進行轉換
Function BytesToBstr(body,Cset)
dim objstream
set objstream =CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode = 3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function

'下面試著調用http://www.proxycn.com/html_proxy/30fastproxy-1.html的html內容
Dim Url,Html,Temp
Url="http://www.proxycn.com/html_proxy/30fastproxy-1.html"
Html = getHTTPPage(Url)
Call getinfo(html)

Sub Getinfo(S)
Dim pl(),m,St
St="</TD><TD class=" & """list""" & ">"
Do
m = m + 1
n = P + Len(St)
P = InStr(n,S,St)
ReDim Preserve pl(m-1)
pl(m-1) = P
loop While P <> 0

For o = 0 to m-1
If o+1 < m-1 Then
T_S=Mid(S,pl(o)+Len(St),pl(o+1)-pl(o)-Len(St))
If Len(T_S) < 30 Then
t=t+1
Select Case t
Case 1
temp = temp & "端口 : " & T_S & vbcrlf
Case 2
temp = temp & "類型 : " & T_S & vbcrlf
Case 3
temp = temp & "地址 : " & T_S & vbcrlf
Case 4
temp = temp & "時間 : " & Now & vbcrlf
Case 5
t=0
Str_Sip = "whois.php?whois="
Str_Eip = "target=_blank>whois</TD></TR>"
n1 = P_Sip + Len(Str_Sip)
P_Sip = InStr(n1,S,Str_Sip)
n2 = P_Eip + Len(Str_Eip)
P_Eip = InStr(n2,S,Str_Eip)
Ip=Mid(S,P_Sip+Len(Str_Sip),P_Eip-P_Sip-Len(Str_Sip))
If PingIp(Ip) = 1 Then
temp = temp & "IP : " & Ip & vbcrlf
If MsgBox (temp,vbyesno,"是否繼續? " )=vbno Then
WScript.quit
End If
End If
temp = ""
End Select
End If
Else
MsgBox " 沒有了",vbokonly,"提示"
WSCript.quit
End If
Next
End Sub

Function PingIp(host)
On Error Resume Next
strComputer = "."
strTarget = host
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colPings = objWMIService.ExecQuery _
("Select * From Win32_PingStatus where Address = '" & strTarget & "'")
If Err = 0 Then
Err.Clear
For Each objPing in colPings
If Err = 0 Then
Err.Clear
If objPing.StatusCode = 0 Then
PingIp = 1
temp = temp & "速度 : " & objPing.ResponseTime & " 毫秒" & vbcrlf
'MsgBox strTarget & " responded to ping." & vbcrlf &_
'"Responding Address: " & objPing.ProtocolAddress & vbcrlf &_
'"Responding Name: " & objPing.ProtocolAddressResolved & vbcrlf &_
'"Bytes Sent: " & objPing.BufferSize & vbcrlf &_
'"Time: " & objPing.ResponseTime & " ms" & vbcrlf &_
'"TTL: " & objPing.ResponseTimeToLive & " seconds"
Else
PingIp = 0
'MsgBox strTarget & " did not respond to ping." &_
'"Status Code: " & objPing.StatusCode
End If
Else
Err.Clear
PingIP = 0
'MsgBox "Unable to call Win32_PingStatus on " & strComputer & "."
End If
Next
Else
Err.Clear
PingIp = 0
'MsgBox "Unable to call Win32_PingStatus on " & strComputer & "."
End If
End Function

感謝各位的閱讀!關于“vbs如何實現搜索代理地址”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,讓大家可以學到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

vbs
AI

万州区| 铜川市| 长泰县| 灌云县| 海宁市| 昌平区| 敦煌市| 旺苍县| 寿宁县| 志丹县| 新干县| 定安县| 凤台县| 万源市| 崇文区| 绥滨县| 峡江县| 乐安县| 衡山县| 米易县| 宣恩县| 县级市| 恩施市| 新邵县| 淮北市| 灯塔市| 广灵县| 轮台县| 自治县| 沅江市| 新巴尔虎左旗| 凤凰县| 南安市| 青浦区| 闻喜县| 清徐县| 贡嘎县| 兴文县| 吉安县| 锡林郭勒盟| 苏尼特左旗|