public static PetShop.IDAL.IItem CreateItem()
{
string path = System.Configuration.ConfigurationSettings.AppSettings["WebDAL"];
//web.config's <appsettings> use sqlserverDAL's information .code:<add key="WebDAL" value="PetShop.SQLServerDAL" />
string className = path + ".Item";
//return petshop.sqlserverdal.item
return (PetShop.IDAL.IItem)Assembly.Load(path).CreateInstance(className);
//assembly.load(path) meaning :1.the load is with petshop.sqlserverDAL.dll 2.create petshop.sqlserverdal.item's instance
//3.return interface IItem 4.while bll use IItem interface , bll have been petshop.sqlserverdal.item class code }
调试时错误为:
/警告 “System.Configuration.ConfigurationSettings.AppSettings”已过时:“This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings”
这是为什么啊??怎么改啊???
{
string path = System.Configuration.ConfigurationSettings.AppSettings["WebDAL"];
//web.config's <appsettings> use sqlserverDAL's information .code:<add key="WebDAL" value="PetShop.SQLServerDAL" />
string className = path + ".Item";
//return petshop.sqlserverdal.item
return (PetShop.IDAL.IItem)Assembly.Load(path).CreateInstance(className);
//assembly.load(path) meaning :1.the load is with petshop.sqlserverDAL.dll 2.create petshop.sqlserverdal.item's instance
//3.return interface IItem 4.while bll use IItem interface , bll have been petshop.sqlserverdal.item class code }
调试时错误为:
/警告 “System.Configuration.ConfigurationSettings.AppSettings”已过时:“This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings”
这是为什么啊??怎么改啊???
解决方案 »
- 求一个按KEY排序VALUE的算法
- 无法绑定由多个部分组成的标识符
- 在XP下 安装了VS2008 再安装VS2003 还可以吗?
- 连接sql2005 用户 'sa' 登录失败
- c#怎样遍历 DropDownList1的每个ListItem的值
- 急急急急急急急!!!BMP图像处理
- 怎么给ListView和TreeView控件加背景图片
- 谁有 Janus.WinForms.Controls.Suite.v2.0.1000注册机 啊
- 一个简单的Soap问题,为什么我的Soap不能运行?
- 判断json是否含有某个字段的方法
- AxWMPLib.AxWindowsMediaPlayer在哪引用啊
- 服务端如何客户端ip地址
解决了