如何使用下一个上一个按钮连接多个文本文件 [英] How to connect multiple text files using next previous buttons
本文介绍了如何使用下一个上一个按钮连接多个文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
PLZ回复我
如何在窗口应用程序中使用C#连接多个文本文件。
plz reply me
How to connect multiple text files using next previous buttons useing C# in window application.
推荐答案
阅读所有文件从文件夹中的数组
Read All Files to The Array from the Folder
var files = from file in Directory.GetFiles(@"Folder Path")
orderby file descending
select file;
int count=files.Count();
string[] array= files.ToArray();
读取您所需的文件按钮CLick事件
Read The Required File in your button CLick event
TextReader objstream = new StreamReader(array[0]);
richTextBox1.Text = objstream.ReadToEnd();
objstream.Close();
这篇关于如何使用下一个上一个按钮连接多个文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文