实例:
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="CGSYS.Properties.Settings.xsmbscgbeifengConnectionString"
connectionString="Data Source=WWW-5776C56F273;Initial Catalog=xsmbscgl06;User ID=sa"
providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<!--数据库连接配置-->
<add key="ConnectionString" value="server=ZHANG-1D093B228;user id =sa; password =SA; database = xsmbscgl04" />
<add key="ConnectionName" value="ZHANG-1D093B228" />
</appSettings>
</configuration>在朋友的项目里,copy出这样一个配置文件.
app.config是用户自定义配置文件,能够比较灵活修改一些配置信息,如数据库连接.
其语法符合XML.