![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
vb2013 net combobox 要把ComboBox中的内容保存到文本文件。问怎么存,怎么取。要代码。
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
1个回答
展开全部
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
'从"d:\t.txt"
ComboBox1.Items.AddRange(IO.File.ReadAllLines("d:\t.txt", System.Text.Encoding.Default))
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
'写入"d:\t.txt"
IO.File.WriteAllLines("d:\t.txt", ComboBox1.Items.OfType(Of String).ToArray, System.Text.Encoding.Default)
End Sub
'从"d:\t.txt"
ComboBox1.Items.AddRange(IO.File.ReadAllLines("d:\t.txt", System.Text.Encoding.Default))
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
'写入"d:\t.txt"
IO.File.WriteAllLines("d:\t.txt", ComboBox1.Items.OfType(Of String).ToArray, System.Text.Encoding.Default)
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询