Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Imports System.Net
- Public Class Form1
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim fo As New OpenFileDialog
- fo.RestoreDirectory = True
- fo.Multiselect = False
- fo.Filter = "txt files (*.txt)|*.txt"
- fo.FilterIndex = 1
- fo.ShowDialog()
- If (Not fo.FileName = Nothing) Then
- Dim proxies As New List(Of String)
- Using sr As New StreamReader(fo.FileName)
- While sr.Peek <> -1
- proxies.Add(sr.ReadLine())
- End While
- End Using
- Dim myProxy As WebProxy
- For Each proxy As String In proxies
- Try
- myProxy = New WebProxy(proxy)
- Dim r As HttpWebRequest = HttpWebRequest.Create("http://www.google.com")
- r.UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.2 Safari/537.36"
- r.Timeout = 3000
- r.Proxy = myProxy
- Dim re As HttpWebResponse = r.GetResponse()
- ListBox1.Items.Add("Working Proxy: " & proxy)
- Catch ex As Exception
- ListBox1.Items.Add("Unresponsive Proxy: " & proxy)
- End Try
- Next
- End If
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- If (ListBox1.Items.Count > 0) Then
- Dim fs As New SaveFileDialog
- fs.RestoreDirectory = True
- fs.Filter = "txt files (*.txt)|*.txt"
- fs.FilterIndex = 1
- fs.ShowDialog()
- If Not (fs.FileName = Nothing) Then
- Using sw As New StreamWriter(fs.FileName)
- For Each line As String In ListBox1.Items
- sw.WriteLine(line)
- Next
- End Using
- End If
- End If
- End Sub
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
- If (ListBox1.Items.Count > 0) Then
- Dim fs As New SaveFileDialog
- fs.RestoreDirectory = True
- fs.Filter = "txt files (*.txt)|*.txt"
- fs.FilterIndex = 1
- fs.ShowDialog()
- If Not (fs.FileName = Nothing) Then
- Using sw As New StreamWriter(fs.FileName)
- For Each line As String In ListBox1.Items
- If (line.StartsWith("Working Proxy: ")) Then sw.WriteLine(line)
- Next
- End Using
- End If
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement