开发者

How to read file with custom extension to textBox

开发者 https://www.devze.com 2023-03-27 04:31 出处:网络
Is there any way to read file with custom extension to textBox? Is there 开发者_运维知识库any convertation to some supported formats?

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

精彩评论

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