Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net.Mail
- Public Class Form1
- Private Sub Button1_Click() Handles Button1.Click
- If CheckBox1.Checked = True Then
- TextBox3.Text = "ftp://ftp.drivehq.com"
- End If
- Try
- Dim request As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(TextBox3.Text & TextBox5.Text & "/" & TextBox6.Text), System.Net.FtpWebRequest)
- ProgressBar1.Value = 20
- request.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
- request.Method = System.Net.WebRequestMethods.Ftp.UploadFile
- ProgressBar1.Value = 40
- Dim file() As Byte = System.IO.File.ReadAllBytes(TextBox4.Text)
- ProgressBar1.Value = 50
- Dim strz As System.IO.Stream = request.GetRequestStream
- ProgressBar1.Value = 60
- strz.Write(file, 0, file.Length)
- strz.Close()
- ProgressBar1.Value = 80
- strz.Dispose()
- ProgressBar1.Value = 100
- Label10.Text = "File sent!"
- Catch ex As Exception
- MsgBox("File not sent! Check your information!", MsgBoxStyle.Critical, "Error!")
- End Try
- End Sub
- Private Sub Button2_Click() Handles Button2.Click
- OpenFileDialog1.ShowDialog()
- End Sub
- Private Sub OpenFileDialog1_FileOk() Handles OpenFileDialog1.FileOk
- TextBox4.Text = OpenFileDialog1.FileName
- End Sub
- Private Sub Button3_Click() Handles Button3.Click
- TextBox1.Text = ""
- TextBox2.Text = ""
- TextBox3.Text = ""
- TextBox4.Text = ""
- TextBox5.Text = ""
- TextBox6.Text = ""
- CheckBox1.Checked = False
- Label10.Text = ""
- ProgressBar1.Value = 0
- End Sub
- Private Sub Button5_Click() Handles Button5.Click
- FontDialog1.ShowDialog()
- RichTextBox1.Font = FontDialog1.Font
- End Sub
- Private Sub Button4_Click() Handles Button4.Click
- OpenFileDialog1.ShowDialog()
- TextBox11.Text = OpenFileDialog1.FileName
- End Sub
- Private Sub Button6_Click() Handles Button6.Click
- Try
- If RadioButton1.Checked = True Then
- TextBox12.Text = "smtp.gmail.com"
- TextBox13.Text = "587"
- ElseIf RadioButton2.Checked = True Then
- TextBox12.Text = "smtp.live.com"
- TextBox13.Text = "587"
- End If
- ProgressBar2.Value = 20
- Dim Mail As New MailMessage
- Mail.Subject = TextBox10.Text
- Mail.To.Add(TextBox9.Text)
- ProgressBar2.Value = 40
- Mail.From = New MailAddress(TextBox7.Text)
- Mail.Body = RichTextBox1.Text
- ProgressBar2.Value = 50
- If Not TextBox11.Text = Nothing Then
- Dim Attach As Net.Mail.Attachment = New Net.Mail.Attachment(TextBox4.Text)
- Mail.Attachments.Add(Attach)
- End If
- ProgressBar2.Value = 60
- Dim SMTP As New SmtpClient(TextBox12.Text)
- SMTP.EnableSsl = True
- SMTP.Credentials = New System.Net.NetworkCredential(TextBox7.Text, TextBox8.Text)
- ProgressBar2.Value = 80
- SMTP.Port = TextBox13.Text
- SMTP.Send(Mail)
- ProgressBar2.Value = 100
- Label19.Text = "Message sent!"
- Catch ex As Exception
- MsgBox("Message not sent, check your information!", MsgBoxStyle.Critical, "Error!")
- End Try
- End Sub
- Private Sub Button7_Click() Handles Button7.Click
- TextBox7.Text = ""
- TextBox8.Text = ""
- TextBox9.Text = ""
- TextBox10.Text = ""
- TextBox11.Text = ""
- TextBox12.Text = ""
- TextBox13.Text = ""
- RadioButton1.Checked = False
- RadioButton2.Checked = False
- RadioButton3.Checked = False
- RichTextBox1.Text = ""
- ProgressBar2.Value = 0
- Label19.Text = ""
- End Sub
- Private Sub Button9_Click() Handles Button9.Click
- Dim SAPI
- SAPI = CreateObject("SAPI.spvoice")
- SAPI.Speak(TextBox14.Text)
- End Sub
- Private Sub Button10_Click() Handles Button10.Click
- If TextBox16.Text = My.Settings.username And TextBox15.Text = My.Settings.password Then
- Form2.ShowDialog()
- End If
- If TextBox16.Text <> My.Settings.username Or TextBox15.Text <> My.Settings.password Then
- 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!")
- End If
- End Sub
- Private Sub Button11_Click() Handles Button11.Click
- My.Settings.username = "username"
- My.Settings.password = "password"
- MsgBox("Username and password reset!", MsgBoxStyle.Information, "Successful!")
- End Sub
- Private Sub Button12_Click() Handles Button12.Click
- Timer1.Enabled = True
- End Sub
- Private Sub Button13_Click() Handles Button13.Click
- Timer1.Enabled = False
- End Sub
- Private Sub Timer1_Tick() Handles Timer1.Tick
- Shell("Ping " + (TextBox17.Text + "-1" + "65000"))
- End Sub
- End Class
Add Comment
Please, Sign In to add comment