将组合框项添加到文本文件中 [英] Add combobox items to text file
本文介绍了将组合框项添加到文本文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将所有组合框项目添加到servers.txt中的文本文件中。
我需要逐行列出文本文件的项目,但现在所有项目都打印在一个文件中单行。
例如:
我的组合框项目:
a
b
c
但是在文本文件中= abc
如何让它们出现在文本文件的连续行中?
给我一些例子。
谢谢。
I want to add all combobox items to a text file in servers.txt.
I need the items of the text file to be listed line by line but right now all items are printed in one single line.
For example:
my combobox items:
a
b
c
But in text file = abc
How can I make them appear in consecutive lines in the text file?
Give me some examples.
Thanks.
推荐答案
要做的步骤:
1)使用每个......下一个 [ ^ ]浏览组合框项目的集合并将其存储在字符串变量中(例如:mydata字符串
)通过字符串连接 [ ^ ](mydata = mydata& ComboBoxItem
),
)将mydata
值保存到文本文件中:如何:将文本写入文件 [ ^ ]
试试吧!它很容易实现;)
Steps to do:
1) using for each ... next[^] go through the collection of combobox items and store it in a string variable (for example:mydata As String
) via string concatenation[^] (mydata = mydata & ComboBoxItem
),
2) savemydata
value to a text file: How to: Write Text to a File[^]
Try! It's simple to achieve ;)
这篇关于将组合框项添加到文本文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文