需要今天日期的目录中的文件

时间:2017-07-06 18:06:47

标签: c# path

我正在尝试创建一个方法,告诉我传递给它的参数中是否有当前日期的文件。

到目前为止,这是我的方法:

launch.json
填充了 fileEntries但是获取今天的文件的最佳方式是什么(如果存在的话)?

谢谢!

EDIT1

这就是我改为:

DoesFileExist("c:\temp\file*.*");

private static bool DoesFileExist(string file)
{
  var dir = Path.GetDirectoryName(file);
  var nfile = Path.GetFileName(file);
  var fileEntries = Directory.GetFiles(dir, nfile);
  foreach (string fileName in fileEntries)
  {
    Console.WriteLine(fileName);
  }
  return true;
}

1 个答案:

答案 0 :(得分:3)

使用 static void StackOverflow(Args _args) { EnumId Id = enumNum(SalesType); DictEnum dictEnum = new DictEnum(Id); int EnumValue = enum2Int(SalesType::Journal); //Replace Base enum for Your Base Enum. info(dictEnum.index2Symbol(EnumValue)); //info(dictEnum.index2Label(EnumValue)); //Optional only reference }

$oSelect = DB::table('statistics')
          ->where('statistics.league_id', $league_id)
          ->select('id, AVG('statistics.points as points'),player_id, scheduled')
          ->orderBy('statistics.scheduled','DESC')
          ->groupBy('statistics.player_id');
相关问题