I am very new to VB.net and anything I do know is self taught so please bear with me
I am trying to develop a program that will allow a user to select files using the open file dialog. The files will then be copied into multiple directories that the user selects from another open file dialog. All selections are listed in a list box. When the user hits the Go button the selected files are copied to all the selected directories.
At least that is my intent.
I have struggled with this and looked at a bunch of sample code and just cannot get it put together.
The code I have so far is:
vb
Imports System.IO
Dim File2Copy As String
Private Sub Close(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
Private Sub File(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
OpenFD.Multiselect = True
If OpenFD.ShowDialog = DialogResult.OK Then
For Each s As String In OpenFD.FileNames
ListBox2.Text &= s & Environment.NewLine
System.IO.Path.GetFileNameWithoutExtension(s)
'File.Copy(s, File2Copy & "\" & System.IO.Path.GetFileName(s))
Next
End If
End Sub
Private Sub Directories(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFD.Multiselect = True
If OpenFD.ShowDialog = DialogResult.OK Then
For Each s As String In OpenFD.FileNames
ListBox1.Text &= s & Environment.NewLine
System.IO.Path.GetFileNameWithoutExtension(s)
File.Copy(s, File2Copy & "\" & System.IO.Path.GetFileName(s))
Next
End If
End Sub
Private Sub Go(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
End Sub
End Class
This post has been edited by PsychoCoder: 29 Feb, 2008 - 02:52 PM