[.NET] Proxy Grabber Tutorial

by Nasyr - 19-04-2015, 08:29 PM
Freak
Posts:
3,295
Joined:
Jan 2015
Likes:
224
Credits:
4,543
Reputation:
119
2 Years of Service
#1
OP
Posted: 19-04-2015, 08:29 PM
Design:
1) Add 3 Buttons.
Button 1 ---> Grab Proxies
Button 2 ---> Save Proxies
Button 3 ---> Clear Proxies
2) Add A ListBox (Proxies will be collected here)
3) Add A Label (Shows total proxies grabbed)

Coding


Code:
Imports System.Text.RegularExpressions
Imports System.Text

Then Click Button 1 (Grab Proxies) & Add:

Code:
Dim the_request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://proxy-ip-list.com/")
       Dim the_response As System.Net.HttpWebResponse = the_request.GetResponse
       Dim stream_reader As System.IO.StreamReader = New System.IO.StreamReader(the_response.GetResponseStream())
       Dim code As String = stream_reader.ReadToEnd
       Dim expression As New System.Text.RegularExpressions.Regex("[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}:[0-9]{1,5}")
       Dim mtac As MatchCollection = expression.Matches(code)
       For Each itemcode As Match In mtac
           ListBox1.Items.Add(itemcode)
       Next
    Label1.Text = ListBox1.Items.Count.ToString

Click Button 2 & Add:

Code:
If ListBox1.Items.Count = (0) Then
           MessageBox.Show("No Proxies found, Please try grabbing again", "ALERT!", MessageBoxButtons.OK, MessageBoxIcon.Error)
       Else

           Dim S_W As IO.StreamWriter
'Creating a steamwriter to save files
           Dim itms() As String = {ListBox1.Items.ToString}

           Dim save As New SaveFileDialog
           Dim it As Integer
           save.FileName = "Proxies - Server 2"
           save.Filter = "(*.txt)|*.txt|ALL Files (*.*)|*.*"
           save.CheckPathExists = True
           save.ShowDialog(Me)
           S_W = New IO.StreamWriter(save.FileName)
           For it = 0 To ListBox1.Items.Count - 1
               S_W.WriteLine(ListBox1.Items.Item(it))
           Next
           S_W.Close()
       End If

Finally, Double click the third button & Add:

Code:
ListBox1.Items.Clear()
Label1.Text = "0"

Aokie
Posts:
882
Joined:
Feb 2015
Likes:
55
Credits:
1,302
Reputation:
26
2 Years of Service
#2
Posted: 28-04-2015, 04:10 AM
Great! May use this code in the future for a personal project.
广交友,无深交
Harmony
Posts:
467
Joined:
May 2015
Likes:
32
Credits:
368
Reputation:
19
2 Years of Service
#3
Posted: 09-05-2015, 07:10 PM
Thanks for this Nasyr Heart
UID: 799 I'm an oldfag.
Novice
Posts:
28
Joined:
Jul 2015
Likes:
0
Credits:
12
Reputation:
1
1 Year of Service
#4
Posted: 10-09-2015, 12:16 AM
i dont personally like vbnet but thanks man i will learn about a bit
Member
Prime
Posts:
134
Joined:
Sep 2015
Likes:
0
Credits:
9
Reputation:
0
1 Year of Service
#5
Posted: 12-09-2015, 03:39 AM
thanks man appreciate
The last reply on this thread is older than a month. Please do not unnecessarily bump it.
Register an account or login to reply
Create an account
Create a free account today and start posting right away. It only takes a few seconds.
Login
Log into an existing account.
1 Guest(s)