posts - 124,  comments - 29,  trackbacks - 0
首先可以在解决方案资源管理器中添加->新建项目->配置文件(.config),
写配置文件,如:
1<?xml version="1.0" encoding="utf-8" ?>
2<configuration>
3  <appSettings>
4    <add key ="FactoryName" value="ChineseFactory"/>
5  </appSettings>
6</configuration>

读配置文件
private string FactoryType = null;
        System.Configuration.AppSettingsReader asr 
= new System.Configuration.AppSettingsReader();
1FactoryType = (string)asr.GetValue("FactoryName"typeof(string));
注意语句要写在函数里别直接写在类里面了!!!!!!!!!!!!!!!!!
posted on 2008-06-24 11:08 天书 阅读(616) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理



<2008年6月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

常用链接

留言簿(5)

随笔档案

文章分类

文章档案

好友的Bolg

搜索

  •  

最新评论

阅读排行榜

评论排行榜