title: how to make a text file for logging in c# asp.net
body: <p>here is my code for logging</p>
  
  <pre><code>System.IO.FileInfo perf = new System.IO.FileInfo(System.Web.HttpContext.Current.Server.MapPath("~/perf.log"));
  
  perf.IsReadOnly = false;
  StreamWriter sw = new StreamWriter(perf.ToString(), true);
  
  sw.WriteLine(logString);
  sw.Flush();
  sw.Close();
  </code></pre>
  
  <p>all i want to do is </p>
  
  <pre><code>if(!File.Exists)
  {
     //what should i write here to create a text file?
  }
  else
  {
     //do the upper code logic
  }
  </code></pre>
  
  <p>thank you in advance</p>