string exePath = System.Reflection.Assembly.GetEntryAssembly().Location;
int pos = exePath.LastIndexOf("\\");
configPath = exePath.Substring(0, pos) + "\\" + "Config\\ReportDateBatchConfig.xml";
//文件不存在 则建立一个xml
if (!File.Exists(configPath))
{
File.Create(configPath);
}
配置文件就是用来手动修改的。项目-右键-添加-应用程序配置文件。