Saving listbox items to text file

  • Thread starter Thread starter geol90
  • Start date Start date
G

geol90

Guest
private void button3_Click(object sender, EventArgs e)
{
listBox1.Items.Remove(listBox1.SelectedItem);
string path = @"C:\Windows\System32\drivers\etc\hosts";
StreamWriter sw = new StreamWriter(path, true);
string siteunblk = listBox1.Text;
sw.Write(siteunblk);
sw.Close();
}

qBMgM.png


Need help saving listbox items to hosts file after i clicked remove

Thanks

Continue reading...
 
Back
Top