我使用的是dev 中的memoEdit控件(和textbox类似)
下面看代码
private void GetFileText()
{
//获取文件相对路径
string path = System.Windows.Forms.Application.StartupPath;
path= path.Substring(0,path.Length-10);
//获取文件绝对路径
string folder = Path.Combine(path, "AppData\\Version");
//获取指定目录下所有文件
DirectoryInfo theFile = new DirectoryInfo(folder);
string content = "\r\n";
//判断是否为空
if (theFile.Exists)
{
//建立数组接收所有文件
FileInfo[] arrDir = theFile.GetFiles();
//对文件照版本号进行排序
SortAsFileName(ref arrDir);
//遍历排序后的文件
foreach (FileInfo item in arrDir)
{
string str=null;
//建立阅读流逐行读取文本内容
using (StreamReader sr = new StreamReader($@"{item.FullNa