0
之間找到文件,我有以下代碼:一定阿爾法範圍
string startAlpha = "A";
string StartSubAlpha = "a-e";
var currentPage = Directory.GetFiles(filePath, startAlpha + "*.pdf")
.Skip((pageNum - 1) * pageSize)
.Take(pageSize)
.Select(path => new FileInfo(path)).ToArray();
這僅使用startAlpha時的作品。但是我怎樣才能將StartSubAlpha集成到它呢?我希望能夠找到所有具有"Aa-Ae"
(來自上述示例)之間的首字母(前2)的文件。
有什麼建議嗎?
那麼爲什麼不跟着你,從你剛纔的問題接受了答案? (http://stackoverflow.com/questions/9653201) – 2012-03-11 12:16:32
您將不得不恢復使用「外部」正則表達式來篩選結果。 GetFiles的搜索模式根本不支持你所需要的。 – 2012-03-11 12:18:05
[在C#中使用Directory.GetFiles和正則表達式?](http://stackoverflow.com/questions/8443524/using-directory-getfiles-with-a-regex-in-c) – 2012-03-11 12:18:36