Quantcast
Channel: CSDN博客推荐文章
Viewing all articles
Browse latest Browse all 35570

《程序员的第一年》---------- 读写配置文件---Properties.Settings.

$
0
0

                #region   记录进度
               


           //     string s = Properties.Settings.Default.Properties["ExpiredPhotoCleanerProgress"].DefaultValue.ToString();
                DateTime expiredPhotoCleanerProgress = Properties.Settings.Default.ExpiredPhotoCleanerProgress;
                Properties.Settings.Default.ExpiredPhotoCleanerProgress = Properties.Settings.Default.ExpiredPhotoCleanerProgress.AddDays(expiredPhotoCleanerStep);
                Properties.Settings.Default.Save();


                //XmlDocument doc = new XmlDocument();
                //try
                //{
                //    doc.Load(Server.MapPath("web.config"));
                //    XmlNode node;
                //    XmlElement element;
                //    node = doc.SelectSingleNode("//appSettings");
                //    element = (XmlElement)node.SelectSingleNode("//add[@key='ExpiredPhotoCleanerProgress']");
                //    element.SetAttribute("value", DateTime.Now.ToString());
                //    doc.Save(Server.MapPath("web.config"));
                //}
                //catch (Exception)
                //{


                //}
                #endregion



www.5ufanli.net


作者:QQ247085994 发表于2013-5-16 10:46:29 原文链接
阅读:39 评论:0 查看评论

Viewing all articles
Browse latest Browse all 35570

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>