Imports System
Imports System.IO
Imports System.Data
Imports System.Environment
Public Class Copia
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents FolderBrowserDialog1 As System.Windows.Forms.FolderBrowserDialog
Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.Label2 = New System.Windows.Forms.Label
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.Button2 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.Button4 = New System.Windows.Forms.Button
Me.FolderBrowserDialog1 = New System.Windows.Forms.FolderBrowserDialog
Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(8, 8)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(168, 24)
Me.Label1.TabIndex = 0
Me.Label1.Text = "File da Copiare:"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(8, 32)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(200, 26)
Me.TextBox1.TabIndex = 1
Me.TextBox1.Text = "C:\File.exe"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(216, 32)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(72, 24)
Me.Button1.TabIndex = 2
Me.Button1.Text = "Sfoglia"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(8, 64)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(168, 24)
Me.Label2.TabIndex = 3
Me.Label2.Text = "Copia in:"
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(8, 88)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(200, 26)
Me.TextBox2.TabIndex = 4
Me.TextBox2.Text = "C:\Nuova Cartella\File.exe"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(216, 88)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(72, 24)
Me.Button2.TabIndex = 5
Me.Button2.Text = "Sfoglia"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(8, 120)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(200, 24)
Me.Button3.TabIndex = 6
Me.Button3.Text = "Copia"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(8, 152)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(200, 24)
Me.Button4.TabIndex = 7
Me.Button4.Text = "Chiudimi"
'
'Copia
'
Me.AutoScaleBaseSize = New System.Drawing.Size(7, 19)
Me.ClientSize = New System.Drawing.Size(292, 184)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.Label1)
Me.Font = New System.Drawing.Font("Comic Sans MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "Copia"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "File Manager - Copia"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Me.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If File.
Exists(TextBox1.
Text) Then
File.
Copy(TextBox1.
Text, TextBox2.
Text)
Else
MessageBox.Show("Il File Richiesto Non Esiste!", "Program Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.ShowDialog()
TextBox1.Text = OpenFileDialog1.FileName
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Str() As String
Str = Split(TextBox1.Text, "\")
FolderBrowserDialog1.ShowDialog()
TextBox2.Text = FolderBrowserDialog1.SelectedPath & "\" & Str(UBound(Str))
End Sub
End Class