遇到一些麻烦,我正在尝试打开最新的 txt 文件。我正在使用一个按钮,我需要打开 txt 文件,因为有几百个文本文件,我需要按日期和时间列出的最后一个文件
//..............更新.............//
这是我的文件外观的一个更好的示例,有一些额外的日志,它们会内容更新
commandlog2012081410 (2012-08-14 / 01:01)
commandlog2012081411 (2012-08-14 / 10:30)
commandlog2012081412 (2012-08-14 / 12:36)
Sample2012082207 (2012-08-22 / 02:12)
Sample2012082208 (2012-08-22 / 06:28)
Sample2012082209 (2012-08-22 / 09:14)
faillog2012075671 (2012-07-17 / 01:20)
faillog2012075672 (2012-07-17 / 08:00)
faillog2012075673 (2012-07-17 / 09:00)
chargedlog203416771 (2012-07-05 / 20:36)
chargedlog203416772 (2012-07-05 / 21:20)
chargedlog203416773 (2012-07-05 / 22:42)
vanishlog2012324795 (2012-07-21 / 17:00)
vanishlog2012324796 (2012-07-21 / 19:31)
vanishlog2012324797 (2012-07-21 / 20:28)
debuglog123131231 (2012-08-22 / 05:10)
debuglog123131232 (2012-08-22 / 06:12)
debuglog123131233 (2012-08-22 / 09:14)
droplogg12313131 (2012-08-06 / 10:10)
droplogg12313132 (2012-08-06 / 16:41)
exitlog123131313 (2012-08-22 / 01:01)
exitlog123131314 (2012-08-22 / 01:12)
exitlog123131315 (2012-08-22 / 09:14)
log201123131 (2012-08-22 / 09:12)
log201123132 (2012-08-22 / 09:14)
我需要打开 //Sample2012082209 (2012-08-22 / 09:14)// 因为你可以看到其他几个 txt 文件在同一日期同时结束,甚至可以选择一个文件并打开它
catch (Exception ex)
{
MessageBox.Show("Error" + ex.Message.ToString());
(Open newest Sample txt file here)
}