我想将新项目添加到字符串数组,或者我可以保留在列表中。有人可以展示如何做到这一点吗?
string sourceDir = "C:\\Users\\ozkan\\Desktop\\foto\\"
string[] picList;
string pattern = "*.jpg|*.png|*.gif";
string[] filters = pattern.Split('|');
foreach (string filter in filters)
{
// I want to collect all files url in picList
// Directory.GetFiles returns string array
picList = Directory.GetFiles(sourceDir, filter);
}