title: getting file name and moving it
body: <pre><code>string fName = Path.GetFileName(tempPaths[z]);    
  if (!File.Exists(subAch + fName))
                              {
  
                                  File.Move(tempPaths[z], subAch + fName);
                                  Console.WriteLine("moved!!! from " + tempPaths[z] + " tooooo ");
  
  
                              }
  </code></pre>
  
  <p>tempPaths is a list with all the image file paths. e.g. ./images/image4.jpg</p>
  
  <p>subAch is a directory string.</p>
  
  <p>I wish to get the file name of the file then move them to another directory. But with the code above i kept getting error: file is being used by other process.</p>
  
  <p>Is there anyway which get the file name and move them? I have tried fileStream but was confused by it.</p>
  
  <p>Please advice.</p>
  
  <p>Thank you!</p>