title: Read Each Line of 2 Multiline Text Box
body: <p>Is there a way to read each line of 2 multi-line text box? In <code>textBox1</code> I have as a multi-line String containing a list of compressed files using the following code:</p>
  
  <pre><code>DirectoryInfo getExpandDLL = new DirectoryInfo(showExpandPath);
  FileInfo[] expandDLL = getExpandDLL.GetFiles("*.dl_");
  foreach (FileInfo listExpandDLL in expandDLL)
  {
      textBox1.AppendText(listExpandDLL + Environment.NewLine);
  }
  </code></pre>
  
  <p>At the moment part of my code is this:</p>
  
  <pre><code>textBox2.Text = textBox1.Text.Replace("dl_", "dll");
  string cmdLine = textDir.Text + "\\" + textBox1.Text + " " + textDir.Text + "\\" + textBox2.Text;
  Process process = new Process();
  ProcessStartInfo startInfo = new ProcessStartInfo();
  startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
  startInfo.FileName = "expand.exe";
  startInfo.UseShellExecute = true;
  startInfo.Arguments = cmdLine.Replace(Environment.NewLine, string.Empty);
  process.StartInfo = startInfo;
  process.Start();
  process.WaitForExit();
  </code></pre>
  
  <p>The code above takes the name of the compressed file in textBox1 and renames it in textBox2 then runs expand.exe to expand the compressed file. The code basically gives expand.exe the following command as an example:</p>
  
  <pre><code>c:\users\nigel\desktop\file.dl_ c:\users\nigel\desktop\file.dll
  </code></pre>
  
  <p>it works great if the folder contains only one line of text in textBox1. With multi-lines of text the command is basically:</p>
  
  <pre><code>c:\users\nigel\desktop\loadsoffiles.dl_ etc and doesnt work!
  </code></pre>
  
  <p>Is there a way to read each line of textBox1, change the string and put it into textBox2 then pass the command to expand.exe?</p>
  
  <pre><code>string cmdLine = textDir.Text + "\\" + lineOFtextBox1 + " " + textDir.Text + "\\" + lineOftextBox2;
  </code></pre>
  
  <p>EDIT: Just to be clear: TextBox1 contains:</p>
  
  <ul>
  <li>somefile.dl_</li>
  <li>someMore.dl_</li>
  <li>evenmore.dl_</li>
  </ul>
  
  <p>as a mulitline. My code takes that multiline text and puts it in textBox2 so it contains:</p>
  
  <ul>
  <li>somefile.dll</li>
  <li>someMore.dll</li>
  <li>evenmore.dll</li>
  </ul>
  
  <p>is there a way to read each line /get each line of textBox1 and textBox2 and do 'stuff' with it?</p>
  
  <p>thank you!</p>