title: foreach file in folder, rename and save
body: <p>I have a simple foreach here where I am have got the folder location using the <code>folderBrowserDialog</code> tool and am now trying to go through each one of the files and replace certain characters within the file name.</p>
  
  <p>I am getting an error which says it cannot find the file when it gets to this part of the code <code>File.Move(_FileName, _NewFileName);</code></p>
  
  <p>Can anyone shed any light on this? Would be much appreciated.</p>
  
  <p>Thanks</p>
  
  <pre><code>foreach (FileInfo Files in Folder.GetFiles())
              {
                  _FileName = Files.Name;
  
                  _NewFileName = _FileName.Replace(" ", "-").Replace(",", "-");
  
                  File.Move(_FileName, _NewFileName);
  
                  File.Delete(_FileName);
  
              }
  </code></pre>