且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何使用XDocument.Load()在应用程序目录中获取文件

更新时间:2022-11-04 19:23:24

另一种绕过资源问题的方法是将文件添加到项目中(与资源解决方案相同),然后单击文件,然后在属性选项卡中选择复制到输出路径中的始终复制".这样,文件在构建时将被复制到输出目录,就像这样做一样简单

Another way that bypass the ressource issue is to add the file to project (same as the ressource solution), then click on the file and in the property tab choose "copy always" in copy to output path. That way the file will get copied to the output directory when you build and it's as simple as doing

 XDocument xml = XDocument.Load("Registro.xml");