<
appSettings
>
< add key = " ORACLEConnectionString " value = " Provider=OraOLEDB.Oracle.1;
Persist Security Info = False;Password = blah;User ID = greg;Data Source = sph; " />
< add key = " SQLConnectionString " value = " data source=SQL1;initial catalog=ID_V;
integrated security = SSPI;persist security info = False;workstation id = TH03D374;
packet size = 4096 " />
</ appSettings >
< add key = " ORACLEConnectionString " value = " Provider=OraOLEDB.Oracle.1;
Persist Security Info = False;Password = blah;User ID = greg;Data Source = sph; " />
< add key = " SQLConnectionString " value = " data source=SQL1;initial catalog=ID_V;
integrated security = SSPI;persist security info = False;workstation id = TH03D374;
packet size = 4096 " />
</ appSettings >
用
<appSettings>
<add key="keyName1" value="keyValue"/>
<add key="keyName2" value="keyValue"/>
</appSettings>
在c#里,使用:
private string strkeyName2= ConfigurationSettings.AppSettings["keyName2"];
来提取
web.config是一种规定格式的xml文件!