How do I select text boxes & ComboBox to export?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Terry Smith
    New Member
    • Aug 2010
    • 1

    #1

    How do I select text boxes & ComboBox to export?

    The following is the current code for the export button on my app;

    Code:
    private void btnExport_Click(object sender, EventArgs e)
            {          
                string filename;
                filename = DateTime.Now.Date.ToShortDateString();
                filename = filename.Replace("/", "-");
                filename += ".txt";
    
                TextWriter writer;
                if (File.Exists(filename))
                {
                    writer = File.AppendText(filename);
                }
                else
                {
                    writer = File.CreateText(filename);
                }
            }
    I'm at a loss as to how I make it select the content of the combo box (cboClient) and the three text boxes (txtBackup, txtAV, txtOther) to export them to the .txt file.

    Ideally what I'd like to see in the .txt file is;

    <Client>: <txtBackupconte nt> <txtAVcontent > <txtOtherconten t>

    However, I'm stuck as to how to do that.

    Any help would be greatly appreciated.
Working...