VB.NET 单击按钮后,弹出保存文件对话框,把ListBox的内容保存到.txt中,每个item占一行
发布网友
发布时间:2022-10-10 20:09
我来回答
共1个回答
热心网友
时间:2023-10-09 09:51
SaveFileDialog1.Filter = "文本文档|*.txt"
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
FileOpen(1, SaveFileDialog1.FileName, IO.FileMode.Open, OpenAccess.Write)
For i As Integer = 0 To ListBox1.Items.Count - 1
Print(1, ListBox1.Items(i).ToString)
Next
FileClose(1)
End If