RichTextBox的LoadFile函数的用法
来源:互联网 发布:广州轰趴馆 知乎 编辑:程序博客网 时间:2024/06/02 04:28
string path = ""; openFileDialog.Filter = "所有文件|*.*|记事本文件|*.txt|doc文档|*.doc"; openFileDialog.InitialDirectory = "D:\\"; if (DialogResult.OK == openFileDialog.ShowDialog()) { path = openFileDialog.FileName; FileStream fs = new FileStream(path, FileMode.OpenOrCreate); RichTextBoxStreamType streamType; //文件扩展名 string fileExt = path.Substring(path.LastIndexOf('.') + 1); switch (fileExt) { case "txt": // 文本文件 streamType = RichTextBoxStreamType.PlainText; break; case "rtf": // 写字板 streamType = RichTextBoxStreamType.RichText; break; case "srt": // 影片字幕 streamType = RichTextBoxStreamType.UnicodePlainText; break; case "lrc": // 歌词文件 streamType = RichTextBoxStreamType.PlainText; break; case "xml": // XML文件 streamType = RichTextBoxStreamType.PlainText; break; default: // 默认类型 streamType = RichTextBoxStreamType.PlainText; break; } rtbContent.LoadFile(fs, streamType); }
0 0
- RichTextBox的LoadFile函数的用法
- richTextBox换行的用法
- c#中richTextBox的用法
- Assembly.Load,Assembly.LoadFrom,Assembly.LoadFile的简单用法
- WPF中richtextbox的一些用法
- require、dofile、loadfile的区别
- Assembly的LoadFile()和LoadFrom()的区别
- RichTextBox用法——设置指定字符串的颜色
- c# RichTextBox用法——设置指定字符串的颜色
- Lua中require、dofile、loadfile的区别
- Lua的loadfile、dofile、loadstring、require
- Assembly的load, loadfrom, loadfile方法总结
- Lua中require、dofile、loadfile的区别
- lua中dofile,loadfile,require的区别
- lua中require、dofile、loadfile的区别
- lua中dofile,loadfile,require的区别
- Lua中require、dofile、loadfile的
- RichTextBox的翻页算法
- hjfhgjfgh
- js中prototype用法详细介绍
- rcp程序无法启动问题
- Caffe使用step by step:caffe框架下的基本操作和分析
- 廖雪峰python学习笔记1:hello python
- RichTextBox的LoadFile函数的用法
- 十种常见的营销策略
- DM8168 系统编译、启动、烧写
- Lua continue
- Tkinter教程之Canvas(1)篇
- Python序列化模型数据为JSON
- PHP中文乱码
- Python 脚本获取上一个工作日的方法
- elasticsearch 别名的操作