在web.config中定义常量方法

web.config中设置:

<configuration>
  <appSettings>
    <add key="email" value="test@163.com"/>
。。。。。。

在test.aspx.cs文件中(ConfigurationManager.AppSettings的指令集::System.Configuration)

string email = ConfigurationManager.AppSettings["email"];

在test.cs中可以用你的常量了。

 

参考资料:

http://zhidao.baidu.com/question/336996466.html

http://stackoverflow.com/questions/1612367/asp-net-session-state-not-enabled-properly

 

posted @ 2012-12-03 15:25  蜕变成长  阅读(382)  评论(0编辑  收藏  举报