profile.cs

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

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

namespace BookShop.DALFactory {
	
	/// <summary>
	/// Factory implementaion for the Profile DAL object
	/// </summary>
	public class Profile {

		public static BookShop.IDAL.IProfile Create() {
			
			/// Look up the DAL implementation we should be using
			string path = System.Configuration.ConfigurationSettings.AppSettings["WebDAL"];
			string className = path + ".Profile";

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

⌨️ 快捷键说明

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