Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Kirtan PatelRank #292 · 8.6K reputationPosted Dec 26, 2009, 5:15 AM EST
Kirtan PatelRank #292 · 8.6K reputationPosted Dec 25, 2009, 12:42 PM EST
// Writing List box content to txt File
using System.IO;
private void button1_Click(object sender, EventArgs e)
{
string filename = "data.txt";
string listboxData = "";
foreach (string str in listBox1.Items)
{
listboxData += str + "\n";
}
File.WriteAllText(filename, listboxData);
}
Dave Chika67 reputationPosted Dec 25, 2009, 1:00 PM EST
Dave Chika67 reputationPosted Dec 25, 2009, 1:15 PM EST
Hello, Kirtan.ur code is working but the data am storing gotten from Eight (8) which are arranged in colums but ur code mixes evertin up.
Dave Chika67 reputationPosted Dec 25, 2009, 1:22 PM EST
Hiren SoniRank #694 · 3.5K reputationPosted Dec 25, 2009, 3:35 PM EST
to save in c drive and
give example of item which is in you listbox