不知道C#有没有模糊查询文件的函数,只要对某文件夹里的文件名进行模糊查询就行!
谢谢!
------解决方案--------------------------------------------------------
这估计得翻翻API了- -
------解决方案--------------------------------------------------------
先获取文件夹下文件名称数组
然后用Linq查询
------解决方案--------------------------------------------------------
不知道用错没有,你试试
- C# code
DirectoryInfo di = new DirectoryInfo(); string[] filelist = di.GetFiles(@"C:\ma"); foreach (string s in filelist) { if (s.Contains("eee")) { MessageBox.Show("存在eee文件"); } }