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 天书 阅读(619) 评论(0)  编辑 收藏 引用

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



<2013年6月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

常用链接

留言簿(5)

随笔档案

文章分类

文章档案

好友的Bolg

搜索

  •  

最新评论

阅读排行榜

评论排行榜