How to Write to a file using StreamWriter?
<p>in my Wpf app I'm using a class Person (that is a base class), and that contains a virtual method SaveData(), and other class Client that inherits from Person. How to override method SaveData() and keeping data from base?</p>

<p>Class Person</p>

<pre><code>public virtual void SaveData()
{
   string arqName = string.Format("Person{0}" + ".txt", Id);
   StreamWriter file = new StreamWriter(arqNome);
   file.WriteLine("ID: " + Id);
   file.WriteLine("DOB: " + dOB);
   file.WriteLine("Name: " + name);
   file.WriteLine("Age: " + age);
   file.Flush();
   file.Close();     
}
</code></pre>

<p>Class Client</p>

<pre><code>public override void SaveData()
{
   base.SaveData();
   string arqName = string.Format("Person{0}" + ".txt", Id);
   StreamWriter file = new StreamWriter(arqNome);
   file.WriteLine("Cod: " + cod);
   file.WriteLine("Credits: " + credits);
   file.Flush();
   file.Close();
}
</code></pre>

<p>The override method in Client is indeed override others data as Name, Age, DOB... I need to mantains both in same file.</p>