private bool CopyingWithProgressBar(ArrayList myAl) { bool result = true; try { Object[] helpArr = myAl.ToArray(); pBar1.Visible = true; pBar1.Minimum = 0; pBar1.Maximum = helpArr.Length; pBar1.Value = 1; pBar1.Step = 1; for (int x = 0; x < helpArr.Length; x++) { string input = helpArr[x].ToString().Substring(0, helpArr [x].ToString().IndexOf(",")); string target = helpArr[x].ToString().Substring(helpArr [x].ToString().IndexOf(",") + 1); File.Copy(input, target, true); Thread.Sleep(100); pBar1.PerformStep(); } myAl.Clear(); myAl.TrimToSize(); myAl = null; helpArr= null; } catch (Exception ex) { MessageBox.Show("Some Problems with copy." + ex.Message, "Error.", MessageBoxButtons.OK, MessageBoxIcon.Error); result = false; } return result; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)