惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
C
CXSECURITY Database RSS Feed - CXSecurity.com
V
Visual Studio Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
小众软件
小众软件
L
LangChain Blog
Cyberwarzone
Cyberwarzone
美团技术团队
The Register - Security
The Register - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tor Project blog
V
V2EX
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
L
LINUX DO - 最新话题
Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
aimingoo的专栏
aimingoo的专栏
人人都是产品经理
人人都是产品经理
F
Full Disclosure
V2EX - 技术
V2EX - 技术
The Cloudflare Blog
博客园 - 叶小钗
T
Threat Research - Cisco Blogs
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Latest news
Latest news
S
Security @ Cisco Blogs
Spread Privacy
Spread Privacy
Project Zero
Project Zero
K
Kaspersky official blog
MyScale Blog
MyScale Blog
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
Hacker News - Newest:
Hacker News - Newest: "LLM"
大猫的无限游戏
大猫的无限游戏
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
C
Cybersecurity and Infrastructure Security Agency CISA
Webroot Blog
Webroot Blog
罗磊的独立博客
Vercel News
Vercel News
N
News and Events Feed by Topic
A
Arctic Wolf
C
CERT Recently Published Vulnerability Notes

博客园 - PENGHAO-X

indows 8上强制Visual Studio以管理员身份运行 jQuery中浏览器版本判断的一个BUG,此BUG已影响到jqModal,thickbox等多个jQuery插件的应用 [注意]你的系统中存在这个BUG吗?(正则表达式验证) SQL 2005 except,intersect [收藏 ]针对IE网页浏览器不同版本解释的CSS或javascript .NET Framework 3.5中序列化成JSON数据及JSON数据的反序列化,以及jQuery的调用JSON Windows 2003 远程桌面连接出错解决办法。(由于协议错误,会话将被中断。请重新连接到远程计算机。) CSS hack:区分IE6,IE7,firefox ListView 中的一个低级 BUG 全国哀悼日 灰色CSS滤镜 将字符串对转换成字典(临时表)的自定义函数(SQL) [转载][收藏][新]正则表达式30分钟入门教程[2007-8-3 V2.21] 获取表中新记录(下一条记录)的主键值的存储过程 如何进入程序设计的领域 用ASP设计购物推车 - PENGHAO-X - 博客园 XHTML 1.0 参考 JS代码--HTML自动转为JS代码 - PENGHAO-X - 博客园 文本输入限制 - PENGHAO-X - 博客园 JS代码--选择日期
.NET 2.0中,配置文件app.config的读写(VS2005,C#)
PENGHAO-X · 2006-10-07 · via 博客园 - PENGHAO-X

在.NET 2.0中对配置文件app.config文件的读写变得相当简单了,在创建一个新的项目后VS2005会自动生成配置文件(Settings.settings)及app.config,如没有请:右键项目--属性--设置里添加一条配置信息(如下图),VS2005将自动生成这些文件:
User Specifc Application Settings

Settings.Designer.cs

namespace WindowsApplication1.Properties 
{
    
internal sealed partial class Settings : 
             global::System.Configuration.ApplicationSettingsBase 
    
{
       
private static Settings defaultInstance = ((Settings)
          (global::System.Configuration.ApplicationSettingsBase.Synchronized(
           
new Settings())));

       
public static Settings Default 
       
{
          
get return defaultInstance; }
       }


       [global::System.Configuration.UserScopedSettingAttribute()]
       [global::System.Configuration.DefaultSettingValueAttribute(
"Form1")]
       
public string testSetting 
       
{
          
get return ((string)(this["testSetting"]));   }
          
set this["testSetting"= value;              }
       }

   }

}

VS2005基本都完成了,现在我们读写时就只需要写几行代码就行了:

            Properties.Settings config = Properties.Settings.Default;
            
//读取
            string str = config.testSetting;
            
//写入
            config.testSetting = "test value";
            config.Save();

其它更详细的写方法介绍:
http://www.codeproject.com/useritems/SystemConfiguration.asp
http://www.codeproject.com/useritems/SystemConfiguration.asp