title: how to check whether a file exists before creating it
body: <p>I am creating an xml file. I need to check first if the file exists or not. If the file does not exist, create it and add the data cmg from a .cs file.</p>
  
  <p>If the file exists, don't create the file just add the data cmg from a .cs file.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>string filename="c:\\employee.xml";
  XmlTextWriter tw=new XmlTextWriter(filename,null);//null represents 
  the Encoding Type//
  tw.Formatting=Formatting.Indented; //for xml tags to be indented//
  tw.WriteStartDocument(); //Indicates the starting of document (Required)//
  tw.WriteStartElement("Employees"); 
  tw.WriteStartElement("Employee","Genius");
  tw.WriteStartElement("EmpID","1");
  tw.WriteAttributeString("Name","krishnan");
  tw.WriteElementString("Designation","Software Developer");
  tw.WriteElementString("FullName","krishnan Lakshmipuram Narayanan");
  tw.WriteEndElement();
  tw.WriteEndElement();
  tw.WriteEndDocument(); 
  tw.Flush();
  tw.Close();
  </code></pre>
  
  <ul>
  <li>so next time we add data to file we need to check if the file exits and add data to xml file  </li>
  <li>and as we have made empID as a primary key, if user tries to make duplicate entry we need to avoid</li>
  </ul>
  
  <p>Is this possible to do?</p>