Search

just show me the code

Monday, February 2, 2009

read from the web.config

web.config

   16   <appSettings>
   28     <add key="EndDate" value="2009-02-03 03:00 AM"/> 
   29   </appSettings>


Code behind

    3 using System.Configuration;
    ...
   54         string sEnd = ConfigurationManager.AppSettings["EndDate"].ToString();
   55         DateTime dtEnd = DateTime.ParseExact(sEnd, "yyyy-MM-dd HH:mm tt", null);
 

No comments:

Post a Comment

Contributors