Get the App
SLTechnology News&Howtos  ›  Development  › 

How to search proxy address by vbs

Shulou Source: shulou.com Published: 2022-06-03 06:53:08 11月15日 Update

This article is about how vbs can search for proxy addresses. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The code is as follows:

'1. Enter the address of the url target web page, and the return value getHTTPPage is the html code of the target web page.

Function getHTTPPage (url)

Dim Http

Set Http=CreateObject ("MSXML2.XMLHTTP")

Http.open "GET", url,false

Http.send ()

If Http.readystate4 then

Exit function

End if

GetHTTPPage=bytesToBSTR (Http.responseBody, "GB2312")

Set http=nothing

If err.number0 then err.Clear

End function

'2. Convert random horse. If you call a web page with Chinese characters directly with xmlhttp, you will get random horse, which can be converted through adodb.stream component.

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

'Let 's try to call the html content of http://www.proxycn.com/html_proxy/30fastproxy-1.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 (), mforce St

St= ""

Do

M = m + 1

N = P + Len (St)

P = InStr (nmai Sme St)

ReDim Preserve pl (mmur1)

Pl (mmur1) = P

Loop While P 0

For o = 0 to MMI 1

If oilfield 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 "

N1 = P_Sip + Len (Str_Sip)

P_Sip = InStr (N1 Smenade Strange Sip)

N2 = P_Eip + Len (Str_Eip)

P_Eip = InStr (N2 Smeng Strange Eip)

Ip=Mid (Str_Sip), P_Eip-P_Sip-Len (Str_Sip))

If PingIp (Ip) = 1 Then

Temp = temp & "IP:" & Ip & vbcrlf

If MsgBox (temp,vbyesno, "do you want to continue?") = vbno Then

WScript.quit

End If

End If

Temp = ""

End Select

End If

Else

MsgBox "gone", vbokonly, "hint"

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 & "Speed:" & objPing.ResponseTime & "milliseconds" & 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." & _

'"StatusCode:" & 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

Thank you for reading! This is the end of the article on "how to achieve the search agent address in vbs". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Tags: Address content web page agent search code more goal article good practical can be passed character article time Chinese look knowledge port type Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MariaDB Shulou Tech Info Xiaomi Docker