Copying multiple files ( help )

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
17 posts Page 2 of 2
Contributors
User avatar
CodenBoy
Top Poster
Top Poster
Posts: 103
Joined: Sun Jul 15, 2012 4:06 pm

Thanks man!!!
loove;

i will ask this simple question here because i dont want to start new topic = waste of space of site so this the question

Can I put a label ( Files Remaining: and the number of files needs to be copied ?
maybe this will work or no idk just asking if its then what the code?

Thanks

Best programmer for ever is Begoh7!!
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

Re: Copying multiple files ( help )
comathi
You could use this (I already inserted it in Bogoh's code, so you can just use as is ;) )
Code: Select all
  ProgressBar1.Maximum = ListBox1.Items.Count
  Dim itemCount As Integer = ListBox1.Items.Count
  Dim itemMax As Integer = ListBox1.Items.Count
  Label1.Text = Convert.ToString(itemCount) & " items remaining on " & Convert.ToString(itemMax) & " items."
        For i As Integer = 0 To ListBox1.Items.Count - 1
            Dim thestrings() As String = ListBox1.Items(i).ToString.Split("\")
            Dim filename As String = thestrings(thestrings.Length - 1)
            FileCopy(ListBox1.Items(i), "C:\Test\" & filename)
            ProgressBar1.Value = i + 1
            itemCount -=1
            Label1.Text = Convert.ToString(itemCount) & " items remaining on " & Convert.ToString(itemMax) & " items."
        Next
        MsgBox("File Completed Copying", MsgBoxStyle.Information, "Done!")
User avatar
CodenBoy
Top Poster
Top Poster
Posts: 103
Joined: Sun Jul 15, 2012 4:06 pm

thanks for ur help comathi :)
EDIT: it stays 0 out of 20 or anything
it stays "0" not changing :o
Last edited by CodenBoy on Sun Jul 15, 2012 6:48 pm, edited 1 time in total.
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

Re: Copying multiple files ( help )
comathi
Would you by any chance have TeamViewer? It might be easier for me, or anyone else for that matter, to help you if they can actually see how you placed the code.
User avatar
CodenBoy
Top Poster
Top Poster
Posts: 103
Joined: Sun Jul 15, 2012 4:06 pm

Sure, i sent you my teamviewer id and password by PM

Thanks loove;
User avatar
Bogoh67
VIP - Site Partner
VIP - Site Partner
Posts: 656
Joined: Sun Apr 18, 2010 8:20 pm

Re: Copying multiple files ( help )
Bogoh67
#comathi shouldnt it be Label1.Text = i & " items remaining on " & Convert.ToString(itemMax) & " items."
User avatar
CodenBoy
Top Poster
Top Poster
Posts: 103
Joined: Sun Jul 15, 2012 4:06 pm

Thanks bogoh and comathi,
you both helped me alot
17 posts Page 2 of 2
Return to “Coding Help & Support”