Greetings
New to Visual Studio 2008.
Always us VB6.0 SP5.
I am trying to copy files from A to B.
I select a directory, and copy files. Works ok, but it does not create the
directory first.
snippet.
Private Sub cmdTo_Click(ByV al sender As System.Object, ByVal e As
System.EventArg s) Handles cmdTo.Click
'Open the Dialog Box to Copy Files.
With FolderBrowserDi alog1
..ShowNewFolder Button = True
..Description = "Select the Location for Files to be copied to."
..RootFolder = Environment.Spe cialFolder.Desk top
End With
' If a file is not opened, then set the initial directory to the
' FolderBrowserDi alog.SelectedPa th value.
If lblTo.Text = "" Then
lblTo.Text = FolderBrowserDi alog1.SelectedP ath
lblTo.Text = Nothing
End If
' Display the openFile dialog.
Dim result As DialogResult = FolderBrowserDi alog1.ShowDialo g()
' OK button was pressed.
If (result = DialogResult.OK ) Then
lblTo.Text = FolderBrowserDi alog1.SelectedP ath
' Cancel button was pressed.
ElseIf (result = DialogResult.Ca ncel) Then
Return
End If
Exit Sub
End Sub
Private Sub cmdCopy_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles cmdCopy.Click
''''My.Computer .FileSystem.Cre ateDirectory(lb lTo.Text & "\" &
lblFrom.Text)"" "" Does not work
My.Computer.Fil eSystem.CopyDir ectory(lblFrom. Text, lblTo.Text, _
FileIO.UIOption .AllDialogs, FileIO.UICancel Option.DoNothin g)
Exit Sub
I have added this line
My.Computer.Fil eSystem.CreateD irectory(lblTo. Text & "\" & lblFrom.Text)
Does not except this. In VB6 I could create a directory with from "\" to.
How do you create a directory, when selection is made.
--
Thanks in advance
bob
ro******@mounta incable.net