Questo sito utilizza cookies, anche di terze parti, per mostrare pubblicità e servizi in linea con il tuo account. Leggi l'informativa sui cookies.
Username: Password: oppure
File Manager - Elimina.vb

Elimina.vb

Caricato da:
Scarica il programma completo

  1. Imports System
  2. Imports System.IO
  3. Imports System.Data
  4. Imports System.Environment
  5. Public Class Elimina
  6.     Inherits System.Windows.Forms.Form
  7.  
  8. #Region " Windows Form Designer generated code "
  9.  
  10.     Public Sub New()
  11.         MyBase.New()
  12.  
  13.         'This call is required by the Windows Form Designer.
  14.         InitializeComponent()
  15.  
  16.         'Add any initialization after the InitializeComponent() call
  17.  
  18.     End Sub
  19.  
  20.     'Form overrides dispose to clean up the component list.
  21.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  22.         If disposing Then
  23.             If Not (components Is Nothing) Then
  24.                 components.Dispose()
  25.             End If
  26.         End If
  27.         MyBase.Dispose(disposing)
  28.     End Sub
  29.  
  30.     'Required by the Windows Form Designer
  31.     Private components As System.ComponentModel.IContainer
  32.  
  33.     'NOTE: The following procedure is required by the Windows Form Designer
  34.     'It can be modified using the Windows Form Designer.  
  35.     'Do not modify it using the code editor.
  36.     Friend WithEvents Label1 As System.Windows.Forms.Label
  37.     Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
  38.     Friend WithEvents Button1 As System.Windows.Forms.Button
  39.     Friend WithEvents Button2 As System.Windows.Forms.Button
  40.     Friend WithEvents Button3 As System.Windows.Forms.Button
  41.     Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
  42.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  43.         Me.Label1 = New System.Windows.Forms.Label
  44.         Me.TextBox1 = New System.Windows.Forms.TextBox
  45.         Me.Button1 = New System.Windows.Forms.Button
  46.         Me.Button2 = New System.Windows.Forms.Button
  47.         Me.Button3 = New System.Windows.Forms.Button
  48.         Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog
  49.         Me.SuspendLayout()
  50.         '
  51.         'Label1
  52.         '
  53.         Me.Label1.Location = New System.Drawing.Point(8, 8)
  54.         Me.Label1.Name = "Label1"
  55.         Me.Label1.Size = New System.Drawing.Size(200, 24)
  56.         Me.Label1.TabIndex = 0
  57.         Me.Label1.Text = "File da Eliminare:"
  58.         '
  59.         'TextBox1
  60.         '
  61.         Me.TextBox1.Location = New System.Drawing.Point(8, 32)
  62.         Me.TextBox1.Name = "TextBox1"
  63.         Me.TextBox1.Size = New System.Drawing.Size(200, 26)
  64.         Me.TextBox1.TabIndex = 1
  65.         Me.TextBox1.Text = "C:\File.exe"
  66.         '
  67.         'Button1
  68.         '
  69.         Me.Button1.Location = New System.Drawing.Point(216, 32)
  70.         Me.Button1.Name = "Button1"
  71.         Me.Button1.Size = New System.Drawing.Size(72, 24)
  72.         Me.Button1.TabIndex = 2
  73.         Me.Button1.Text = "Sfoglia"
  74.         '
  75.         'Button2
  76.         '
  77.         Me.Button2.Location = New System.Drawing.Point(8, 64)
  78.         Me.Button2.Name = "Button2"
  79.         Me.Button2.Size = New System.Drawing.Size(200, 24)
  80.         Me.Button2.TabIndex = 3
  81.         Me.Button2.Text = "Elimina"
  82.         '
  83.         'Button3
  84.         '
  85.         Me.Button3.Location = New System.Drawing.Point(8, 96)
  86.         Me.Button3.Name = "Button3"
  87.         Me.Button3.Size = New System.Drawing.Size(200, 24)
  88.         Me.Button3.TabIndex = 4
  89.         Me.Button3.Text = "Chiudimi"
  90.         '
  91.         'Elimina
  92.         '
  93.         Me.AutoScaleBaseSize = New System.Drawing.Size(7, 19)
  94.         Me.ClientSize = New System.Drawing.Size(292, 128)
  95.         Me.Controls.Add(Me.Button3)
  96.         Me.Controls.Add(Me.Button2)
  97.         Me.Controls.Add(Me.Button1)
  98.         Me.Controls.Add(Me.TextBox1)
  99.         Me.Controls.Add(Me.Label1)
  100.         Me.Font = New System.Drawing.Font("Comic Sans MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  101.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
  102.         Me.MaximizeBox = False
  103.         Me.MinimizeBox = False
  104.         Me.Name = "Elimina"
  105.         Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  106.         Me.Text = "File Manager - Elimina"
  107.         Me.ResumeLayout(False)
  108.  
  109.     End Sub
  110.  
  111. #End Region
  112.  
  113.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  114.         OpenFileDialog1.ShowDialog()
  115.         TextBox1.Text = OpenFileDialog1.FileName
  116.     End Sub
  117.  
  118.     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  119.         Me.Close()
  120.     End Sub
  121.  
  122.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  123.         If File.Exists(TextBox1.Text) Then
  124.             File.Delete(TextBox1.Text)
  125.         Else
  126.             MessageBox.Show("Il File Richiesto Non Esiste!", "Program Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
  127.         End If
  128.     End Sub
  129. End Class