App.config文件如下:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="HandlerFolders" type="System.Configuration.DictionarySectionHandler"/>
</configSections>
<!--待处理的文件目录-->
<HandlerFolders>
<add key="Folder1" value="F:\test\batchReplaceImg\htmltemp\"/>
<add key="Folder2" value="f:\test\css"/>
<add key="Folder3" value="f:\test\js"/>
</HandlerFolders>
</configuration>
获取配置内容
public static IDictionary GetHandleFolders()
{
IDictionary folders = (IDictionary)ConfigurationManager.GetSection("HandlerFolders");
return folders;
}