title: The process cannot access the file 'D:.txt' because it is being used by another process in c#
body: <p>I have a pdf file which i am trying to read and write into text file in c# using itext.Now i have created a text file and trying to write my pdf values into it but it is giving following error..</p>
  
  <blockquote>
    <p>The process cannot access the file 'D:\9008028901.txt' because it is being used by another process.</p>
  </blockquote>
  
  <p>Here is my code in c#..</p>
  
  <pre><code>public bool ExtractText(string inFileName, string outFileName)
  {
      StreamWriter outFile = null;
      try
      {
         // Create a reader for the given PDF file
         PdfReader reader = new PdfReader(inFileName);
         outFile = File.CreateText(outFileName);
  
         outFile = new StreamWriter(outFileName, false, System.Text.Encoding.UTF8);
  </code></pre>
  
  <p>Here in my code text file is getting created but i ma not able to write any thing in it.My text file is blank.
  Please help me..</p>