Questions tagged «system.io.directory»

20
System.IO.Directory.GetFiles的多个文件扩展名searchPattern
将多个文件扩展名设置为searchPatternon 的语法是什么Directory.GetFiles()?例如,筛选出扩展名为.aspx和.ascx的文件。 // TODO: Set the string 'searchPattern' to only get files with // the extension '.aspx' and '.ascx'. var filteredFiles = Directory.GetFiles(path, searchPattern); 更新:LINQ不是一个选项,它必须searchPattern传递给GetFiles,如问题中所指定。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.