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(); }
随机文章
热门文章
热评文章
- labVIEW调用C# dll 步骤
- UDP穿透NAT的原理与实现(UDP“打洞”原理)
- C#图像处理(各种旋转、改变大小、柔化、锐化、雾化、底片、浮雕、黑白、滤镜效果)
- C# 生成图片缩略图
- 安装包制作工具 SetupFactory使用2 API清单
- 永恒之蓝病毒是什么 怎么防范ONION勒索软件
- Linux下python2.7安装pip
- ESP8266在Eclipse下设置编译模式(有boot和无boot)