account.cs

来自「ASP.net网站开发四“酷”全书:新闻、论坛、电子商城、博客_源码」· CS 代码 · 共 23 行

CS
23
字号
using System;
using System.Reflection;
using System.Configuration;

namespace BookShop.DALFactory {
	
	/// <summary>
	/// Factory implementaion for the Account DAL object
	/// </summary>
	public class Account
	{
		public static BookShop.IDAL.IAccount Create()
		{			
			/// Look up the DAL implementation we should be using
			string path = System.Configuration.ConfigurationSettings.AppSettings["WebDAL"];
			string className = path + ".Account";

			// Using the evidence given in the config file load the appropriate assembly and class
			return (BookShop.IDAL.IAccount) Assembly.Load(path).CreateInstance(className);
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?