如何获取.txt文件的值? [英] how to get a value of the .txt file?
本文介绍了如何获取.txt文件的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要读取.txt文件,并且必须在文本框中显示该值.
hai dudes ............
帮帮我.........
怎么可能.............
i need to read the .txt file and i have to display that value in text box.
hai dudes............
help me.........
how can its possible.............
推荐答案
1.将文本文件读取为字符串.
2.将字符串设置为TextBox.Text
[^ ]属性.
您遇到哪部分困难?
1. read the text file into a string.
2. set the string into theTextBox.Text
[^] property.
Which part of this are you having difficulty with?
如果文件的整个text
要显示在TextBox
中,则可以使用以下方法
If the entiretext
from the file is to be displayed in theTextBox
, then following method can be used
TextBox1.Text = System.IO.File.ReadAllText(fileName);
尝试此操作
如何:从文件中读取文本
[ ^ ]
try this
How to: Read Text from a File
[^]
这篇关于如何获取.txt文件的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文