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中” 的相关文章
UDP"打洞"原理 1. NAT分类根据Stun协议(RFC3489),NAT大致分为下面四类1) Full Cone这种NAT内部的机器...
1.工具类代码 using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Windows...
1、委托 两个窗体,窗体很简单,只实现改变颜色功能,一看就会: 代码如下,只贴按钮事件代码: 打开Form2按钮事件 private void button1_Click(object s...
一、采用C# 编写,可以批量监控路由器是否正常 功能: 1.显示当前路由IP、名字、实时上行速度、实时下行速度、主机数量、连接数、CPU占用率、内存占用率、CPU温度、运行时间等 2.可以显示10分钟实时流量 3.可以显示历史2小时、...
以下代码是程序入口文件 using DDS_Form1; using System; using System.Collections.Generic; using System.IO; //using System.Linq; using System.Windows.Forms;...
C#动态加载第三方DLL 当我们需要加载第三方非托管DLL时,通常会直接使用DllImport的方式,代码如下: [DllImport("GetFile.dll", CallingConvention = CallingConvention.StdCall,...
评论列表
admin IP:
8年前 (2016-05-28)