c#打开txt文件并导入到textbox中
C
- OpenFileDialog openFileDialog = new OpenFileDialog();
- openFileDialog.Title = " 请选择您要导入的模板文件:";
- openFileDialog.Filter = "TextDocument(*.txt)|*.txt|TextDocument(*.ini)|*.ini";
- openFileDialog.ShowDialog();
- if (openFileDialog.FileName != "")//判断文件名是否为空
- {
- StreamReader streamReader = new StreamReader(openFileDialog.FileName, Encoding.Default);
- this.txtextBox.Text = streamReader.ReadToEnd();
- }
- 随机文章
- 热门文章
- 热评文章
- Libview写软件更新升级程序
- 微信公众平台API接口扩展包
- 在树莓派/linux上使用阿里云DNS解析作为DDNS使用
- C#图像处理(各种旋转、改变大小、柔化、锐化、雾化、底片、浮雕、黑白、滤镜效果)
- SmartLink原理
- HTTP请求头详解
- C#全局监听Windows键盘事件
- linux SSH登录时自动邮件提醒