批量复制文件

Posted on 2019-01-05 14:16  努力成长静待花开  阅读(240)  评论(0编辑  收藏  举报

实现效果:

  

知识运用:

  File类的Copy方法

  public static void Copy (string sourceFileName, string destFileName)

实现代码:

        private void button3_Click(object sender, EventArgs e)
        {
            foreach (object o in listBox1.SelectedItems)
                File.Copy(textBox1.Text + "\\" + o.ToString(), textBox2.Text + "\\" + o.ToString());
        }