Guest User

Untitled

a guest
Oct 18th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.18 KB | None | 0 0
  1. Imports System.Net.Mail
  2. Public Class Form1
  3. Private Sub Button1_Click() Handles Button1.Click
  4. If CheckBox1.Checked = True Then
  5. TextBox3.Text = "ftp://ftp.drivehq.com"
  6. End If
  7. Try
  8. Dim request As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(TextBox3.Text & TextBox5.Text & "/" & TextBox6.Text), System.Net.FtpWebRequest)
  9. ProgressBar1.Value = 20
  10. request.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
  11. request.Method = System.Net.WebRequestMethods.Ftp.UploadFile
  12. ProgressBar1.Value = 40
  13. Dim file() As Byte = System.IO.File.ReadAllBytes(TextBox4.Text)
  14. ProgressBar1.Value = 50
  15. Dim strz As System.IO.Stream = request.GetRequestStream
  16. ProgressBar1.Value = 60
  17. strz.Write(file, 0, file.Length)
  18. strz.Close()
  19. ProgressBar1.Value = 80
  20. strz.Dispose()
  21. ProgressBar1.Value = 100
  22. Label10.Text = "File sent!"
  23. Catch ex As Exception
  24. MsgBox("File not sent! Check your information!", MsgBoxStyle.Critical, "Error!")
  25. End Try
  26. End Sub
  27. Private Sub Button2_Click() Handles Button2.Click
  28. OpenFileDialog1.ShowDialog()
  29. End Sub
  30. Private Sub OpenFileDialog1_FileOk() Handles OpenFileDialog1.FileOk
  31. TextBox4.Text = OpenFileDialog1.FileName
  32. End Sub
  33. Private Sub Button3_Click() Handles Button3.Click
  34. TextBox1.Text = ""
  35. TextBox2.Text = ""
  36. TextBox3.Text = ""
  37. TextBox4.Text = ""
  38. TextBox5.Text = ""
  39. TextBox6.Text = ""
  40. CheckBox1.Checked = False
  41. Label10.Text = ""
  42. ProgressBar1.Value = 0
  43. End Sub
  44. Private Sub Button5_Click() Handles Button5.Click
  45. FontDialog1.ShowDialog()
  46. RichTextBox1.Font = FontDialog1.Font
  47. End Sub
  48. Private Sub Button4_Click() Handles Button4.Click
  49. OpenFileDialog1.ShowDialog()
  50. TextBox11.Text = OpenFileDialog1.FileName
  51. End Sub
  52. Private Sub Button6_Click() Handles Button6.Click
  53. Try
  54. If RadioButton1.Checked = True Then
  55. TextBox12.Text = "smtp.gmail.com"
  56. TextBox13.Text = "587"
  57. ElseIf RadioButton2.Checked = True Then
  58. TextBox12.Text = "smtp.live.com"
  59. TextBox13.Text = "587"
  60. End If
  61. ProgressBar2.Value = 20
  62. Dim Mail As New MailMessage
  63. Mail.Subject = TextBox10.Text
  64. Mail.To.Add(TextBox9.Text)
  65. ProgressBar2.Value = 40
  66. Mail.From = New MailAddress(TextBox7.Text)
  67. Mail.Body = RichTextBox1.Text
  68. ProgressBar2.Value = 50
  69. If Not TextBox11.Text = Nothing Then
  70. Dim Attach As Net.Mail.Attachment = New Net.Mail.Attachment(TextBox4.Text)
  71. Mail.Attachments.Add(Attach)
  72. End If
  73. ProgressBar2.Value = 60
  74. Dim SMTP As New SmtpClient(TextBox12.Text)
  75. SMTP.EnableSsl = True
  76. SMTP.Credentials = New System.Net.NetworkCredential(TextBox7.Text, TextBox8.Text)
  77. ProgressBar2.Value = 80
  78. SMTP.Port = TextBox13.Text
  79. SMTP.Send(Mail)
  80. ProgressBar2.Value = 100
  81. Label19.Text = "Message sent!"
  82. Catch ex As Exception
  83. MsgBox("Message not sent, check your information!", MsgBoxStyle.Critical, "Error!")
  84. End Try
  85. End Sub
  86. Private Sub Button7_Click() Handles Button7.Click
  87. TextBox7.Text = ""
  88. TextBox8.Text = ""
  89. TextBox9.Text = ""
  90. TextBox10.Text = ""
  91. TextBox11.Text = ""
  92. TextBox12.Text = ""
  93. TextBox13.Text = ""
  94. RadioButton1.Checked = False
  95. RadioButton2.Checked = False
  96. RadioButton3.Checked = False
  97. RichTextBox1.Text = ""
  98. ProgressBar2.Value = 0
  99. Label19.Text = ""
  100. End Sub
  101. Private Sub Button9_Click() Handles Button9.Click
  102. Dim SAPI
  103. SAPI = CreateObject("SAPI.spvoice")
  104. SAPI.Speak(TextBox14.Text)
  105. End Sub
  106. Private Sub Button10_Click() Handles Button10.Click
  107. If TextBox16.Text = My.Settings.username And TextBox15.Text = My.Settings.password Then
  108. Form2.ShowDialog()
  109. End If
  110. If TextBox16.Text <> My.Settings.username Or TextBox15.Text <> My.Settings.password Then
  111. MsgBox("Wrong username or password! Please ignore this if you just closed a form, I don't know how to fix it XD", MsgBoxStyle.Critical, "Try again!")
  112. End If
  113. End Sub
  114. Private Sub Button11_Click() Handles Button11.Click
  115. My.Settings.username = "username"
  116. My.Settings.password = "password"
  117. MsgBox("Username and password reset!", MsgBoxStyle.Information, "Successful!")
  118. End Sub
  119. Private Sub Button12_Click() Handles Button12.Click
  120. Timer1.Enabled = True
  121. End Sub
  122. Private Sub Button13_Click() Handles Button13.Click
  123. Timer1.Enabled = False
  124. End Sub
  125. Private Sub Timer1_Tick() Handles Timer1.Tick
  126. Shell("Ping " + (TextBox17.Text + "-1" + "65000"))
  127. End Sub
  128. End Class
Add Comment
Please, Sign In to add comment