Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 C# 处理 WCF,需要在配置文件中配置所有 WCF 服务列表。而不是在加载项目时动态添加手动想要它。你能帮我解决这个问题吗?
要枚举具有给定模式的所有文件,您可以尝试以下代码:
Directory.EnumerateFiles("~", "*.svc", SearchOption.AllDirectories) .Select(Path.GetFileName) .ToList();