Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Public Class Form1
- dim working as boolean=false
- dim workthread as Thread
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- if working=true
- MsgBox("Already Busy Working")
- exit sub
- end if
- workthread = New Thread(AddressOf WorkSub)
- workthread.start()
- End Sub
- Sub WorkSub()
- working=true
- Dim LineOfText As String = "test.txt"
- Dim i As Integer
- Dim aryTextFile() As String
- Dim TextLine As String
- If System.IO.File.Exists(LineOfText) = True Then
- Dim objReader As New System.IO.StreamReader(LineOfText)
- Do While objReader.Peek() <> -1
- TextLine = objReader.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 mailman As New Chilkat.MailMan()
- ' Any string argument automatically begins the 30-day trial.
- Dim success As Boolean
- success = mailman.UnlockComponent("30-day trial")
- If (success <> True) Then
- MsgBox("Component unlock failed")
- Exit Sub
- Else
- End If
- ' Set the POP3 server's hostname
- mailman.MailHost = "pop.aol.com"
- ' Set the POP3 login/password.
- mailman.PopUsername = aryTextFile(0)
- mailman.PopPassword = aryTextFile(1)
- ' 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.
- 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
- MsgBox("success")
- Dim swriter As StreamWriter
- swriter = File.AppendText("good.txt")
- swriter.WriteLine(LineOfText)
- swriter.Close()
- End If
- Loop
- End If
- working=false
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement