title: need to update image file in c#
body: <ol>
  <li><p>I have  800-1000 Uniquely named folders in one large folder.</p></li>
  <li><p>Inside of each uniquely named folder is another folder called /images.</p></li>
  <li><p>And inside of each image folder is a file named "Rock-Star-Site-Design-{UNIQUEFOLDERNAME}-ca-logo.png"</p></li>
  <li><p>I  write a code that replaces all .png files (while keeping the original name) from a .png file which I  supply.</p></li>
  </ol>
  
  <p>The folder structure and filenames need to remain the same.  Basically i am   updating the old file with a new file, using the same (unique) name, 800-1000 times.</p>
  
  <p>The code i have tried working properly but there is one mistake.There are plenty of images inside Image folder,But i need to update only "Rock-Star-Site-Design-{UNIQUEFOLDERNAME}-ca-logo.png"file every folder.</p>
  
  <p>is there any way so i can get file.startwith("Rock-Star").So i can update particular file i want.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>private List&lt;String&gt; DirSearch(string sDir)
  {
      List&lt;String&gt; files = new List&lt;String&gt;();
      try
      {
          foreach (string f in Directory.GetFiles(sDir))
          {
              files.Add(f);
  
  
  
          }
          foreach (string d in Directory.GetDirectories(sDir))
          {
              files.AddRange(DirSearch(d));
          }
  
  
          foreach (var file in files)
          {
              if (!string.IsNullOrWhiteSpace(file))
              {
                  File.Copy(Server.MapPath("ca-logo.jpg"), file,true);
  
              }
          }
  
  
      }
      catch (System.Exception excpt)
      {
          //MessageBox.Show(excpt.Message);
      }
  
      return files;
  }
  </code></pre>