CS代码
AppDomain.CurrentDomain.BaseDirectory + ConfigurationManager.AppSettings["数据库文件路径"];
App.config
<?xml version="1.0" encoding="utf-8"?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/> </startup> <appSettings> <add key="数据库文件路径" value="..\..\Resources\UDFDataWithModule.xml"/> </appSettings> </configuration>