Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. Imports System.IO
  2.  
  3. Public Class Form1
  4.  
  5.  
  6.  
  7. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  8.  
  9. Dim LineOfText As String = "test.txt"
  10. Dim i As Integer
  11. Dim aryTextFile() As String
  12. Dim TextLine As String
  13.  
  14. If System.IO.File.Exists(LineOfText) = True Then
  15.  
  16.  
  17.  
  18. Dim objReader As New System.IO.StreamReader(LineOfText)
  19.  
  20. Do While objReader.Peek() <> -1
  21. TextLine = objReader.ReadLine()
  22.  
  23. aryTextFile = TextLine.Split(":")
  24. For i = 0 To UBound(aryTextFile)
  25.  
  26.  
  27.  
  28. Next i
  29.  
  30.  
  31. ' The mailman object is used for receiving (POP3)
  32. ' and sending (SMTP) email.
  33. Dim mailman As New Chilkat.MailMan()
  34.  
  35. ' Any string argument automatically begins the 30-day trial.
  36. Dim success As Boolean
  37. success = mailman.UnlockComponent("30-day trial")
  38. If (success <> True) Then
  39. MsgBox("Component unlock failed")
  40. Exit Sub
  41. Else
  42.  
  43. End If
  44.  
  45.  
  46.  
  47.  
  48. ' Set the POP3 server's hostname
  49. mailman.MailHost = "pop.aol.com"
  50.  
  51. ' Set the POP3 login/password.
  52. mailman.PopUsername = aryTextFile(0)
  53. mailman.PopPassword = aryTextFile(1)
  54.  
  55. ' You may explicitly begin and end POP3 sessions by calling
  56. ' Pop3BeginSession and Pop3EndSession. However,
  57. ' if a method is called that requires a connection to the POP3
  58. ' server, the connection and session will become established
  59. ' automatically. Therefore, it is not required to explicitly call
  60. ' Pop3BeginSession and Pop3EndSession.
  61.  
  62. success = mailman.Pop3BeginSession()
  63. If (success <> True) Then
  64.  
  65.  
  66.  
  67. LineOfText = String.Join(":", aryTextFile)
  68. MsgBox(LineOfText)
  69.  
  70. MsgBox("Not Success")
  71. Dim swriter As StreamWriter
  72. swriter = File.AppendText("bad.txt")
  73. swriter.WriteLine(LineOfText)
  74. swriter.Close()
  75.  
  76.  
  77. Else
  78.  
  79. MsgBox("success")
  80. Dim swriter As StreamWriter
  81. swriter = File.AppendText("good.txt")
  82. swriter.WriteLine(LineOfText)
  83. swriter.Close()
  84. End If
  85. Loop
  86.  
  87.  
  88. End If
  89.  
  90.  
  91.  
  92. Exit Sub
  93.  
  94. End Sub
  95. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement