title: how to save listbox items in text file?
body: <p>I'm trying to save ListBox items in text file.
  The Items I have added from properties:</p>
  
  <p>My code is:</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
          {
              if (saveFileDialog1.ShowDialog() == DialogResult.OK)
              {
                  using (FileStream S = File.Open(saveFileDialog1.FileName, FileMode.CreateNew))
                      using (StreamWriter st = new StreamWriter(S))
                          foreach (string aa in listBox1.Items)
                              st.WriteLine(listBox1.Items);
              }
          }
  </code></pre>
  
  <p>The output in text file is: System.Windows.Forms.ListBox+ObjectCollection</p>