当前位置:首页 > C# > 正文内容

c#打开txt文件并导入到textbox中

admin10年前 (2015-12-02)C#6827
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();
  • }

扫描二维码推送至手机访问。

版权声明:本文由视觉博客发布,如需转载请注明出处。

本文链接:https://feelsight.cn/post/7.html

标签: C#txt文件

“c#打开txt文件并导入到textbox中” 的相关文章

C#图片处理示例(裁剪,缩放,清晰度,水印)

using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Drawing; using System.Drawing.Drawing2D; usin...

C#修改图片分辨率

public static Bitmap KiResizeImage(Bitmap bmp, int newW, int newH) { try { Bitmap b =...

C# 窗体间传值(Form与From之间互相传值)

C# 窗体间传值(Form与From之间互相传值)

1、委托   两个窗体,窗体很简单,只实现改变颜色功能,一看就会: 代码如下,只贴按钮事件代码: 打开Form2按钮事件 private void button1_Click(object s...

高恪路由器批量管理监控系统

高恪路由器批量管理监控系统

一、采用C# 编写,可以批量监控路由器是否正常 功能: 1.显示当前路由IP、名字、实时上行速度、实时下行速度、主机数量、连接数、CPU占用率、内存占用率、CPU温度、运行时间等 2.可以显示10分钟实时流量 3.可以显示历史2小时、...

c#程序闪退日志记录/异常日志

以下代码是程序入口文件 using DDS_Form1; using System; using System.Collections.Generic; using System.IO; //using System.Linq; using System.Windows.Forms;...

评论列表

admin
admin IP:河南省
9年前 (2016-05-28)

但是但是对方

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。