c#打开txt文件并导入到textbox中
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();
}
“c#打开txt文件并导入到textbox中” 的相关文章
/// <summary> /// MD5验证函数 /// &...
/// <summary> /// 上传文件 /// <...
这篇文章主要介绍了C#获取机器码的方法,结合实例形式详细分析了C#获取硬件机器名、CPU编号、硬盘编号、网卡mac等信息的相关实现方法,需要的朋友可以参考下本文实例讲述了C#获取机器码的方法。分享给大家供大家参考,具体如下:using System.Runtime.InteropServi...
一、各种旋转、改变大小 注意:先要添加画图相关的using引用。 //向右旋转图像90°代码如下: private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) {...
using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Drawing; using System.Drawing.Drawing2D; usin...
public static Bitmap KiResizeImage(Bitmap bmp, int newW, int newH) { try { Bitmap b =...
评论列表
admin IP:
8年前 (2016-05-28)