代码:
private void btnSaveFile_Click(object sender, EventArgs e)
{
listBox1.MultiColumn = true;
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "Text File|*.txt";
if (sfd.ShowDialog() == DialogResult.OK) ;
{
string path = sfd.FileName;
BinaryWriter bw = new BinaryWriter(File.Create(path));
foreach (string s in hello)
{
bw.Write(s + Environment.NewLine);
}
}
输出为
我真的不知道如何摆脱这些角色。