C# copying multiple files with wildcards and keeping file names
<p>I need to copy multiple files from a directory using a textfile that doesnt contain complete info.</p>

<p>NCR.txt:<br>
Red</p>

<p>target directory has in it:<br>
red1.txt<br>
red3.txt<br>
red44.txt  </p>

<p>dest directory needs to have:<br>
red1.txt<br>
red3.txt<br>
red44.txt  </p>

<p>My code:  </p>

<pre><code>System.IO.Directory.CreateDirectory(@"C:\nPrep\" + textBox1.Text + "\\red");
        if (checkBox3.Checked)
        {
            String[] file_names = File.ReadAllLines(@"C:\NCR.txt");

            foreach (string file_name in file_names)
            {
                string[] files = Directory.GetFiles(textBox2.Text, file_name + "*.txt");
                foreach (string file in files)
                    System.IO.File.Copy(file, @"C:\nPrep\" + textBox1.Text + "\\red\\");
            }

        }
</code></pre>
