急:C#中怎么从2个 .txt中读取数据并在界面显示出来,求详细操作,在线等 30
展开全部
贴个简单的消迹哗。就是读拿行取txt中的数据显州州示在一个textbox中
string filepath = Server.MapPath("~/temp/read.txt");
FileStream fs = new FileStream(filepath, FileMode.OpenOrCreate, FileAccess.Read);
StreamReader sr = new StreamReader(fs);
string read = sr.ReadLine();
if (read != null)
{
this.txtDate.Text = read+"\n";
}
string filepath = Server.MapPath("~/temp/read.txt");
FileStream fs = new FileStream(filepath, FileMode.OpenOrCreate, FileAccess.Read);
StreamReader sr = new StreamReader(fs);
string read = sr.ReadLine();
if (read != null)
{
this.txtDate.Text = read+"\n";
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询