C# Recurse Directories using Directory.GetFiles and search pattern

前端 未结 6 1904
时光说笑
时光说笑 2021-01-21 02:42

I want to find all excel files within a directory structure using recursion. The problem is, the search pattern used in Directory.GetFiles only allows a single extension at a t

6条回答
  •  心在旅途
    2021-01-21 03:10

    If you only want to get all excel files, use the pattern ".xl".

    Otherwise I would suggest to call Directory.GetFiles without pattern and filter the matching extensions by hand.

提交回复
热议问题