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

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