日期:2014-05-17 浏览次数:21008 次
//读取当面目录中最新的MDB文件
private string getlastWriteMdbfile(string path)
{
string rfn = "";
try
{
DateTime lstdt = new DateTime();
foreach (string f in System.IO.Directory.GetFiles(path, "*.mdb", System.IO.SearchOption.AllDirectories))
{
System.IO.FileInfo fi = new System.IO.FileInfo(f);
if (rfn == "")
{
lstdt = fi.LastWriteTime;
rfn = f;
}
else
{
if (fi.LastWriteTime > lstdt)
{
lstdt = fi.LastWriteTime;
rfn = f;
}
}
}
addlog ("获得文件名---"+rfn);
}
catch (Exception&nb