private void GetAllLog(string file) { DirectoryInfo di = new DirectoryInfo(file); FileSystemInfo[] fsinfo = di.GetFileSystemInfos(); foreach (FileSystemInfo fs in fsinfo) { if (fs is FileInfo) { if (fs.Extension == ".log") { MainLog +="#"+fs.FullName+"\r\n\r\n"+ ReadLog(File.ReadAllText(fs.FullName)); } } if (fs is DirectoryInfo) GetAllLog(fs.FullName); } }