Copy folders from listbox to another location.
Copy folders from listbox to another location.
Copy folders from listbox to another location.
Copy folders from listbox to another location.
Copy folders from listbox to another location.
Copy folders from listbox to another location. Copy folders from listbox to another location. Copy folders from listbox to another location. Copy folders from listbox to another location. Copy folders from listbox to another location. Copy folders from listbox to another location. Copy folders from listbox to another location. Copy folders from listbox to another location.
Copy folders from listbox to another location. Copy folders from listbox to another location.
Copy folders from listbox to another location.
Go Back  Xtreme Visual Basic Talk > > > Copy folders from listbox to another location.


Reply
 
Thread Tools Display Modes
  #1  
Old 06-22-2010, 07:07 AM
Worf Worf is offline
Newcomer
 
Join Date: Nov 2008
Posts: 14
Default Copy folders from listbox to another location.


Hi.

I have managed to list folders in my listbox1 and the add them to listbox 2.
Now, what i need now is to be able to copy the list of folder in listbox2 to another location.

below is the code i am using.

Browse drive and and fill listbox1 with the folders on that drive.
Path.text hold the path to where the folders.

Code:
  If FolderBrowserDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
            Path.Text = FolderBrowserDialog.SelectedPath


            Dim Dirs As New List(Of String)
            Try
                Dirs.AddRange(My.Computer.FileSystem.GetDirectories(Path.Text))

                ListBox1.BeginUpdate()

                For Each str As String In Dirs
                    ListBox1.Items.Add(My.Computer.FileSystem.GetDirectoryInfo(str).Name)

                    ListBox1.EndUpdate()

                    ' Remove Duplicate items

                    For ii As Integer = ListBox1.Items.Count - 1 To 1 Step -1

                        For j As Integer = ii - 1 To 0 Step -1

                            If ListBox1.GetItemText(ListBox1.Items(ii)) _
                            = ListBox1.GetItemText(ListBox1.Items(j)) Then


                                ListBox1.Items.RemoveAt(ii)

                                Exit For
                            End If
                        Next j
                    Next ii

                    If String.IsNullOrEmpty(str) Then

                        MsgBox("Error")

                        Exit Sub

                    End If

                Next

            Catch ioex As System.UnauthorizedAccessException

            Catch ex As Exception
                Return
            End Try

        End If

I just need to know how to copy the folder that are listed in listbox2 to another location.

Many Thanks

Worf
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Copy folders from listbox to another location.
Copy folders from listbox to another location.
Copy folders from listbox to another location. Copy folders from listbox to another location.
Copy folders from listbox to another location.
Copy folders from listbox to another location.
Copy folders from listbox to another location. Copy folders from listbox to another location. Copy folders from listbox to another location. Copy folders from listbox to another location. Copy folders from listbox to another location. Copy folders from listbox to another location. Copy folders from listbox to another location.
Copy folders from listbox to another location.
Copy folders from listbox to another location.
 
Copy folders from listbox to another location.
Copy folders from listbox to another location.
 
-->