开发者

How to read file with custom extension to textBox

Is there any way to read file with custom extension to textBox? Is there 开发者_运维知识库any convertation to some supported formats? I need read file with custom extension, like text.blahblahblah.


Is there any way to read file with custom extension to textBox?

Sure, just load the file text to the TextBox like:

textBox1.Text = File.ReadAllText(@"Your input file path");

You can let the user choose the file using OpenFileDialog and specify a format accepted in the dialog filter.

If you want to also read rtf text then I think you need a RichTextBox instead of TextBox here so you can read rtf text probably using richTextBox1.Rtf string.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜