-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProxyGrabberForm.vb
63 lines (55 loc) · 2.47 KB
/
ProxyGrabberForm.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Imports DevComponents.DotNetBar
Imports System.Net
Imports System.Text.RegularExpressions
Public Class ProxyGrabberForm
Private Server As String
Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
If RadioButton1.Checked = True Then
Server = "http://www.digitalcybersoft.com/ProxyList/fresh-proxy-list.shtml"
ElseIf RadioButton2.Checked = True Then
Server = "http://aliveproxy.com/us-proxy-list/"
ElseIf RadioButton3.Checked = True Then
Server = "http://proxy-ip-list.com/"
Else
If TextBoxX1.Text = "" Then
MessageBoxEx.Show("Invalid URL", "Invalid URL", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
Server = TextBoxX1.Text
End If
End If
Try
Dim enumerator As IEnumerator
Try
enumerator = Regex.Matches(New WebClient().DownloadString(Server), "\d{1,4}\.\d{1,4}\.\d{1,4}\.\d{1,4}\:\d{2,5}").GetEnumerator
Do While enumerator.MoveNext
Dim current As Match = DirectCast(enumerator.Current, Match)
Me.ListBox1.Items.Add(current)
Loop
Finally
If TypeOf enumerator Is IDisposable Then
TryCast(enumerator, IDisposable).Dispose()
End If
End Try
Catch exception1 As Exception
End Try
End Sub
Private Sub ButtonX3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX3.Click
ListBox1.Items.Clear()
End Sub
Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
Dim FileNumber As Integer = FreeFile()
FileOpen(FileNumber, "Proxy List.txt", OpenMode.Output)
For Each Item As Object In ListBox1.Items
PrintLine(FileNumber, Item.ToString)
Next
FileClose(FileNumber)
MessageBoxEx.Show("Proxy list was saved. It can be found in the same folder as the bot..", "Proxy List", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged
If RadioButton4.Checked = True Then
TextBoxX1.Enabled = True
Else
TextBoxX1.Enabled = False
End If
End Sub
End Class