1.在web.Config的<configuration>节点下面添加 <appSettings>节点
<configuration>
<appSettings>
<add key="Node1" value="Node1Value"/>
<add key="Node2" value="Node2Value"/>
<add key="Node3" value="Node3Value"/>
</appSettings>
</configuration>
2.获取appSettings节点下面的子节点的信息
public static string GetNode1Value()
{
return ConfigurationSettings.AppSettings["Node1"];
}
public static string GetNode2Value()
{
return ConfigurationSettings.AppSettings["Node2"];
}
public static string GetNode3Value()
{
return ConfigurationSettings.AppSettings["Node3"];
}