Multiple filters with Directory.GetFiles?
问题 I'm trying to use multiple filters with the Directory.GetFiles() command. So say I want to match both .html and .css files. I'm using this: Directory.GetFiles(path,"*.html|*.css"); I don't see any documentation however that this is supported, and it ends up not matching either HTML or CSS files. Is there something I'm missing? 回答1: The Directory.GetFiles function doesn't support multiple filters. My solution: string patter = "*.jpg|*.png|*.gif"; string[] filters = patter.Split('|'); foreach