- 在web.config中编写配置信息
<configuration>
<appSettings>
<!--班次ID配置-->
<add key="ShiftIDZao" value="2"/>
<add key="ShiftIDZhong" value="3"/>
<add key="ShiftIDWan" value="1"/>
</appSettings>
</configuration>
- 使用这个配置
//CommonFunction.ObjectToInteger() -----此为公共方法将string类型转int类型
int zao = CommonFunction.ObjectToInteger(System.Configuration.ConfigurationManager.AppSettings["ShiftIDZao"]);
int zhong = CommonFunction.ObjectToInteger(System.Configuration.ConfigurationManager.AppSettings["ShiftIDZhong"]);
int wan = CommonFunction.ObjectToInteger(System.Configuration.ConfigurationManager.AppSettings["ShiftIDWan"]);