폴더 및 파일지정 복사하기
*
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

특정파일 지정하여 복사하기 입니다.

이 게시물을

댓글'2'
교교
  • 2014.06.06
My.Computer.FileSystem.CopyFile(source, dest, True)

and:

System.IO.File.Copy(source, dest, True)

이 댓글을

교교
  • 2014.06.07

My.Computer.FileSystem.CopyDirectory("c:\users\dave\appdata\", "d:\server\users\dave", FileIO.UIOption.AllDialogs, FileIO.UICancelOption.DoNothing)

이 댓글을

공유하기

SEARCH

MENU NAVIGATION