title: File.Move images from a ListView control
body: <p>I'm loading image thumbnails into a ListView control successfully:</p>
  
  <pre><code>lsvImageThumbs.Items.Clear();
          imgl_ImageThumbs.Images.Clear();
  
          string[] files = Directory.GetFiles(@"C:\Documents and Settings\Etc\Desktop\Test");
  
          for (int indexFiles = 0; indexFiles &lt; files.Length; indexFiles++)
          {
              Image img = Image.FromFile(files[indexFiles]);
              DirectoryInfo dinfo = new DirectoryInfo(files[indexFiles]);
              imgl_ImageThumbs.Images.Add(dinfo.Name, img);
              lsvImageThumbs.Items.Add(files[indexFiles], dinfo.Name, indexFiles);
          }
  </code></pre>
  
  <p>Then I can select the image thumbnails and want to Move the files to a directory:</p>
  
  <pre><code>if (dlg.ShowDialog() == DialogResult.OK)
                  {
                      foreach (ListViewItem items in lsvImageThumbs.SelectedItems)
                      {
                          //File.Copy(items.Name, dlg.SelectedPath + "\\" + items.Text);
                          File.Move(items.Name, dlg.SelectedPath + "\\" + items.Text);
                          MessageBox.Show(items.Text + " Taken");
                      }
                  }
  </code></pre>
  
  <p>File.Copy works without a problem but for File.Move I get the following error:</p>
  
  <pre><code>The process cannot access the file because it is being used by another process.
  </code></pre>