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

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

admin9年前 (2015-12-02)C#5805
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();
            }


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

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

本文链接:http://www.cqroom.cn/post/7.html

标签: C#txt文件

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

c#md5与SHA1验证函数

/// <summary>         /// MD5验证函数         /// &...

c#实现FTP上传

/// <summary>         /// 上传文件         /// <...

C#获取机器码的方法详解(机器名,CPU编号,硬盘编号,网卡mac等)

这篇文章主要介绍了C#获取机器码的方法,结合实例形式详细分析了C#获取硬件机器名、CPU编号、硬盘编号、网卡mac等信息的相关实现方法,需要的朋友可以参考下本文实例讲述了C#获取机器码的方法。分享给大家供大家参考,具体如下:using System.Runtime.InteropServi...

 C#图像处理(各种旋转、改变大小、柔化、锐化、雾化、底片、浮雕、黑白、滤镜效果)

C#图像处理(各种旋转、改变大小、柔化、锐化、雾化、底片、浮雕、黑白、滤镜效果)

一、各种旋转、改变大小 注意:先要添加画图相关的using引用。 //向右旋转图像90°代码如下: private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) {...

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 =...

评论列表

admin
admin IP:
8年前 (2016-05-28)

但是但是对方

发表评论

访客

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