WPF讀寫config配置文件單。app
1. 在你的工程中,添加app.config文件。文件的內容默認爲:spa
1 <?xml version="1.0" encoding="utf-8" ?> 2 <configuration> 3 </configuration>
2.若是你想給程序配置一些參數,就在<configuration>標籤中添加<appSettings>.例以下面:code
1 <?xml version="1.0" encoding="utf-8" ?> 2 <configuration> 3 <appSettings> 4 <add key="Path" value="D:\"/> 5 <add key="NAME" value="123"/> 6 </appSettings> 7 </configuration>
3.而後你在後臺程序裏須要的地方讀寫它就能夠了。記住須要添加引用orm
4.讀操做:xml
5.寫操做:blog