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中” 的相关文章
˂span style="margin: 0px; padding: 0px; line-height: 1.5; font-si…
using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Drawing; using System.Drawing.Drawing2D; using…
SetupFactory中可以通过其API控制很复杂的业务需求。 下图中展示了其内置的API种类与具体分类函数。 …
public static Bitmap KiResizeImage(Bitmap bmp, int newW, int newH) { try { Bitmap b = new…
1.工具类代码 using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Windows.Fo…
一、采用C# 编写,可以批量监控路由器是否正常 功能: 1.显示当前路由IP、名字、实时上行速度、实时下行速度、主机数量、连接数、CPU占用率、内存占用率、CPU温度、运行时间等 2.可以显示10分钟实时流量 3.可以显示历史2小时、一天、…