摘要: 通过配置文件配置,达到动态启动相应的服务配置文件配置:将类名之间用分号隔开 启动服务:读取配置文件里面的参数。1、通过反射获取相应的分类对象名称。2、将类对象名传递服务,动态启动 /// /// 启动类服务 /// /// private static void StartServices() { ServiceHost aServiceHost = null; string Services = ConfigurationManager.AppSettin... 阅读全文
posted @ 2012-12-02 00:29 高兴happy 阅读(1892) 评论(0) 推荐(0) 编辑
摘要: 首先新建反射类库 1、命名空间:WitbankData 2、类名:WitbankData方法:public void Other(string accountName, string password, out int i)具体代码如下namespace WitbankData{ public class WitbankData { public static System.Web.HttpCookie MyCookieUser = new System.Web.HttpCookie("SetCookieUser"); /// /// 登... 阅读全文
posted @ 2012-12-02 00:23 高兴happy 阅读(235) 评论(0) 推荐(0) 编辑
摘要: View Code System.Reflection.Assembly ass = Assembly.LoadFrom("WitbankServicesContract1.dll"); //加载反射DLL Type svcType = Type.GetType(Services.Split(';')[i] + "," + "WitbankServicesContract");//反射类名,发布程序集 WitbankServicesContractBLL.ManageExam o = System.Activator. 阅读全文
posted @ 2012-12-02 00:20 高兴happy 阅读(100) 评论(0) 推荐(0) 编辑