Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
The Agent - frmMail.vb

frmMail.vb

Caricato da: Totem
Scarica il programma completo

  1. Imports System.Net.Mail
  2. Public Class frmMail
  3.     Private Sub cmdSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSend.Click
  4.         If txtMail.Text = Nothing Or txtMsg.Text = Nothing Then
  5.             MessageBox.Show("Riempire tutti i campi necessari!", "Error #8", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  6.             Exit Sub
  7.         End If
  8.         If txtName.Text = Nothing Then
  9.             txtName.Text = "Anonimo"
  10.         End If
  11.  
  12.         Try
  13.             Dim Mail As New MailMessage
  14.             Dim Client As New Net.Mail.SmtpClient
  15.  
  16.             Mail.From = New MailAddress(txtMail.Text)
  17.             Mail.IsBodyHtml = False
  18.             Mail.Body = txtMsg.Text
  19.             Mail.ReplyTo = New MailAddress(txtMail.Text)
  20.             Mail.Sender = New MailAddress(txtMail.Text)
  21.             Mail.Subject = "The Agent, Bug Report: da parte di " + txtName.Text
  22.             Mail.To.Add("nicolo1990@yahoo.it")
  23.             Client.Host = "mail.tin.it"
  24.             Client.Send(Mail)
  25.             MessageBox.Show("Hai appena inviato un'e-mail. Al più presto riceverai una risposta!", "Mail inviata", MessageBoxButtons.OK, MessageBoxIcon.Information)
  26.         Catch FE As FormatException
  27.             MessageBox.Show("Inserisci un indirizzo e-mail valido!", "Error #9", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  28.         End Try
  29.     End Sub
  30.  
  31.     'L'agente esegue una lagna terribile credendo di essere malato (:P)
  32.     Private Sub frmMail_Shown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Shown
  33.         With frmHelper.Agente
  34.             If frmHelper.Options.Tragedy_On Then
  35.                 .Play("Confused")
  36.                 .Speak("Cosa?")
  37.                 .Speak("Hai trovato un baco? \Pau=500\ Sono malato?")
  38.                 .Play("Sad")
  39.                 .Speak("No, non ci posso credere! Sono troppo giovane per morire!")
  40.                 .Speak("Tu, aiutami! Abbi un po' di pietà per me, non lasciarmi in balìa delle formiche!")
  41.                 .Speak("Dopotutto, non ti ho fatto niente di male! \Pau=300\ Che cuore hai? Di pietra, te lo dico io!")
  42.                 .Speak("Per te sono solo un ammasso di bit e niente altro? Beh, ciccino, ti sbagli!")
  43.                 .Hide()
  44.                 System.Threading.Thread.Sleep(3000)
  45.                 .Show()
  46.                 .Play("Uncertain")
  47.                 .Speak("Dai, non arrabbiarti, non dicevo sul serio! Curami! Curami! Curamiii!")
  48.             End If
  49.         End With
  50.     End Sub
  51. End Class