如题所述
这不是一句话的事吗?
System.IO.File.WriteAllText(@"C:\Users\Administrator\Desktop\1.txt", string.Join(Environment.NewLine, listBox1.Items.Cast<string>()));
附运行效果图:
方便把代码写出来吗,我是小白,刚学C#