폴더 및 파일지정 복사하기
네크
2014.04.09 08:58:19
*: Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.ShowDialog()
SaveFileDialog1.ShowDialog()
TextBox1.Text = OpenFileDialog1.FileName
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
FolderBrowserDialog1.ShowDialog()
FolderBrowserDialog2.ShowDialog()
TextBox2.Text = FolderBrowserDialog1.SelectedPath()
End Sub
Private Sub RadioButton1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked = True Then
GroupBox1.Enabled = True
GroupBox2.Enabled = False
End If
If RadioButton2.Checked = True Then
GroupBox1.Enabled = False
GroupBox2.Enabled = True
End If
End Sub
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
If RadioButton1.Checked = True Then
My.Computer.FileSystem.CopyFile(OpenFileDialog1.FileName, SaveFileDialog1.FileName)
End If
If RadioButton2.Checked = True Then
My.Computer.FileSystem.CopyDirectory(FolderBrowserDialog1.SelectedPath, FolderBrowserDialog2.SelectedPath)
End If
End Sub
End Class