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 - Controlla.vb

Controlla.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 Controlla
  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 Label2 As System.Windows.Forms.Label
  39.     Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
  40.     Friend WithEvents Button1 As System.Windows.Forms.Button
  41.     Friend WithEvents Button2 As System.Windows.Forms.Button
  42.     Friend WithEvents Button3 As System.Windows.Forms.Button
  43.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  44.         Me.Label1 = New System.Windows.Forms.Label
  45.         Me.TextBox1 = New System.Windows.Forms.TextBox
  46.         Me.Label2 = New System.Windows.Forms.Label
  47.         Me.TextBox2 = New System.Windows.Forms.TextBox
  48.         Me.Button1 = New System.Windows.Forms.Button
  49.         Me.Button2 = New System.Windows.Forms.Button
  50.         Me.Button3 = New System.Windows.Forms.Button
  51.         Me.SuspendLayout()
  52.         '
  53.         'Label1
  54.         '
  55.         Me.Label1.Location = New System.Drawing.Point(8, 8)
  56.         Me.Label1.Name = "Label1"
  57.         Me.Label1.Size = New System.Drawing.Size(216, 24)
  58.         Me.Label1.TabIndex = 0
  59.         Me.Label1.Text = "Controlla L'esistenza di un File:"
  60.         '
  61.         'TextBox1
  62.         '
  63.         Me.TextBox1.Location = New System.Drawing.Point(8, 32)
  64.         Me.TextBox1.Name = "TextBox1"
  65.         Me.TextBox1.Size = New System.Drawing.Size(272, 26)
  66.         Me.TextBox1.TabIndex = 1
  67.         Me.TextBox1.Text = "C:\File.exe"
  68.         '
  69.         'Label2
  70.         '
  71.         Me.Label2.Location = New System.Drawing.Point(8, 64)
  72.         Me.Label2.Name = "Label2"
  73.         Me.Label2.Size = New System.Drawing.Size(256, 24)
  74.         Me.Label2.TabIndex = 2
  75.         Me.Label2.Text = "Controlla L'esistenza di una Cartella:"
  76.         '
  77.         'TextBox2
  78.         '
  79.         Me.TextBox2.Location = New System.Drawing.Point(8, 88)
  80.         Me.TextBox2.Name = "TextBox2"
  81.         Me.TextBox2.Size = New System.Drawing.Size(272, 26)
  82.         Me.TextBox2.TabIndex = 3
  83.         Me.TextBox2.Text = "C:\Nuova Cartella"
  84.         '
  85.         'Button1
  86.         '
  87.         Me.Button1.Location = New System.Drawing.Point(8, 120)
  88.         Me.Button1.Name = "Button1"
  89.         Me.Button1.Size = New System.Drawing.Size(272, 24)
  90.         Me.Button1.TabIndex = 4
  91.         Me.Button1.Text = "Controlla L'esistenza del File"
  92.         '
  93.         'Button2
  94.         '
  95.         Me.Button2.Location = New System.Drawing.Point(8, 152)
  96.         Me.Button2.Name = "Button2"
  97.         Me.Button2.Size = New System.Drawing.Size(272, 24)
  98.         Me.Button2.TabIndex = 5
  99.         Me.Button2.Text = "Controlla L'esistenza della Cartella"
  100.         '
  101.         'Button3
  102.         '
  103.         Me.Button3.Location = New System.Drawing.Point(8, 184)
  104.         Me.Button3.Name = "Button3"
  105.         Me.Button3.Size = New System.Drawing.Size(272, 24)
  106.         Me.Button3.TabIndex = 6
  107.         Me.Button3.Text = "Chiudimi"
  108.         '
  109.         'Controlla
  110.         '
  111.         Me.AutoScaleBaseSize = New System.Drawing.Size(7, 19)
  112.         Me.ClientSize = New System.Drawing.Size(292, 216)
  113.         Me.Controls.Add(Me.Button3)
  114.         Me.Controls.Add(Me.Button2)
  115.         Me.Controls.Add(Me.Button1)
  116.         Me.Controls.Add(Me.TextBox2)
  117.         Me.Controls.Add(Me.Label2)
  118.         Me.Controls.Add(Me.TextBox1)
  119.         Me.Controls.Add(Me.Label1)
  120.         Me.Font = New System.Drawing.Font("Comic Sans MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  121.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
  122.         Me.MaximizeBox = False
  123.         Me.MinimizeBox = False
  124.         Me.Name = "Controlla"
  125.         Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  126.         Me.Text = "File Manager - Controlla"
  127.         Me.ResumeLayout(False)
  128.  
  129.     End Sub
  130.  
  131. #End Region
  132.  
  133.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  134.         If File.Exists(TextBox1.Text) Then
  135.             MessageBox.Show("Il File Richiesto Esiste!", "File Manager", MessageBoxButtons.OK, MessageBoxIcon.Information)
  136.         Else
  137.             MessageBox.Show("Il File Richiesto Non Esiste!", "File Manager", MessageBoxButtons.OK, MessageBoxIcon.Error)
  138.         End If
  139.     End Sub
  140.  
  141.     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  142.         Me.Close()
  143.     End Sub
  144.  
  145.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  146.         If Directory.Exists(TextBox2.Text) Then
  147.             MessageBox.Show("La Cartella Richiesta Esiste!", "File Manager", MessageBoxButtons.OK, MessageBoxIcon.Information)
  148.         Else
  149.             MessageBox.Show("La Cartella Richiesta Non Esiste!", "File Manager", MessageBoxButtons.OK, MessageBoxIcon.Error)
  150.         End If
  151.     End Sub
  152. End Class