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
Virtual Agent Helper - frmModImp.vb

frmModImp.vb

Caricato da: Totem
Scarica il programma completo

  1. Public Class frmModImp
  2.     Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
  3.         Dim W As New IO.StreamWriter(Application.StartupPath + "\Imp\" + dtpImp.Value.ToLongDateString + ".txt")
  4.         W.Write(txtImp.Text)
  5.         W.Close()
  6.         With frmHelper
  7.             .MagoMerlino.Speak(.Sentences(frmHelper.SenNum.Impegni_Salvati))
  8.         End With
  9.     End Sub
  10.     Private Sub cmdErase_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdErase.Click
  11.         With frmHelper
  12.             .MagoMerlino.Stop()
  13.             .MagoMerlino.Play("Confused")
  14.             If MsgBox("Sei sicuro?", MsgBoxStyle.Question + vbYesNo) = MsgBoxResult.Yes Then
  15.                 Kill(Application.StartupPath + "\Imp\" + dtpImp.Value.ToLongDateString + ".txt")
  16.                 .MagoMerlino.Speak(.Sentences(frmHelper.SenNum.Impegni_Cancellati))
  17.             End If
  18.         End With
  19.     End Sub
  20.     Private Sub frmModImp_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  21.         Dim D As Date = Date.Now
  22.         Try
  23.             Dim R As New IO.StreamReader(Application.StartupPath + "\Imp\" + D.ToLongDateString + ".txt")
  24.             txtImp.Text = R.ReadToEnd
  25.             R.Close()
  26.         Catch FNFE As IO.FileNotFoundException
  27.             txtImp.Text = "Nessun impegno per oggi!"
  28.         End Try
  29.     End Sub
  30.     Private Sub dtpImp_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dtpImp.ValueChanged
  31.         Dim D As Date = dtpImp.Value
  32.         Try
  33.             Dim R As New IO.StreamReader(Application.StartupPath + "\Imp\" + D.ToLongDateString + ".txt")
  34.             txtImp.Text = R.ReadToEnd
  35.             R.Close()
  36.         Catch FNFE As IO.FileNotFoundException
  37.             txtImp.Text = "Nessun impegno per oggi!"
  38.         End Try
  39.     End Sub
  40. End Class