'Start Button
'执行以下操作:
.blf
个文件的给定文件夹路径.blf
文件复制到目标文件夹我该怎么做5 ..我哪里错了?
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Const DestinationDirectory As String = "C:\Users\nha4abt\Desktop\Move_Here"
'Show the parent folder path
TextBox1.Text = "C:\Users\nha4abt\Desktop\Ahmad_examaning_folder"
' Show the destination folder path
TextBox2.Text = DestinationDirectory
For Each FileName As String In directory.GetFiles("C:\Users\nha4abt\Desktop\Ahmad_examaning_folder", "*.blf")
File.Copy(FileName, Path.Combine(DestinationDirectory, Path.GetFileName(FileName)))
ListBox1.Items.Clear()
ListBox1.Items.Add(FileName)
Next FileName
For Each FileName In As String In directory.GetFiles("C:\Users\nha4abt\Desktop\Ahmad_examaning_folder", "*.blf")
File.Delete(Path.GetFileName(FileName))
Next FileName
End Sub
答案 0 :(得分:0)
我做到了,得到了结果。这更像是一个愚蠢的错误。
Const DestinationDirectory As String = "C:\Users\nha4abt\Desktop\Move_Here"
'Show the parent folder path
Const ParentDirectory As String = "C:\Users\nha4abt\Desktop\Ahmad_examaning_folder"
TextBox1.Text = ParentDirectory
' Show the destination folder path
TextBox2.Text = DestinationDirectory
ListBox1.Items.Clear()
For Each FileName As String In Directory.GetFiles(ParentDirectory, "*.blf")
File.Copy(FileName, Path.Combine(DestinationDirectory, Path.GetFileName(FileName)))
File.Delete(FileName)
ListBox1.Items.Add(FileName)
Next FileName
End Sub