抽象类!

dll的使用

/// <summary>
/// 返回类型--插件
/// </summary>
/// <param name="baseName"></param>
/// <param name="name"></param>
/// <param name="attname"></param>
/// <returns></returns>
private Type GetPlugin(string baseName, string name, string attname)
{
Hashtable hashtable = this.GetPluginCache();
name = name.ToLower();
Type type = hashtable[name] as Type;
Type result;
if (type == null)
{
if (PluginContainer.pluginCache.Get(this.IndexCacheKey) == null)
{
result = null;
return result;
}
XmlDocument xmlDocument = PluginContainer.pluginCache.Get(this.IndexCacheKey) as XmlDocument;
XmlNode xmlNode = xmlDocument.DocumentElement.SelectSingleNode(string.Concat(new string[]
{
"//",
baseName,
"/item[@",
attname,
"='",
name,
"']"
}));
if (xmlNode == null || !File.Exists(xmlNode.Attributes["file"].Value))
{
result = null;
return result;
}
Assembly assembly = Assembly.Load(PluginContainer.LoadPlugin(xmlNode.Attributes["file"].Value));
type = assembly.GetType(xmlNode.Attributes["identity"].Value, false, true);
if (type != null)
{
hashtable[name] = type;
}
}
result = type;
return result;
}

C# dll加载,抽象方法的使用的更多相关文章

  1. System.load(PWConnector.dll)加载异常 Can't find dependent libraries

    System.load(PWConnector.dll)加载异常 Can't find dependent libraries 错误信息:D:\PWAdapter\PWConnector.dll: C ...

  2. 如何解决SoftekBarcode.dll加载失败的问题

    本文转自:慧都控件网 Softek Barcode Reader Toolkit是专门从事于条形码读取技术的软件公司Softek旗下一款著名的条码读取工具包.最近有部分用户反映在运行此工具包时会遇到“ ...

  3. ACCESS DLL加载错误

    如今还在用ACCESS 2003,太懒没办法,升到2010变化太大了,做个Access的转版挺麻烦的.况且大家都在使用2003,也就懒得搞了. 但问题是office 2003已经out了,(Offic ...

  4. 模块“XXX.dll”加载失败

    具体问题:模块“XXX.dll”加载失败 请确保该二进制存储在指定的路径中,或者调试它以检查该二进制或相关的.DLL文件是否有问题  找不到指定的模块. 1.在安装C++软件的时候,有时候安装失败提示 ...

  5. DLL加载,设置相对路径

    DLL加载,设置相对路径 1. 加载dll方法之一:(./ 代表当前目录,../ 代表上层目录)包含头文件的相对路径(当前路径为源代码路径,路径 “../../” 当前项目文件夹上级目录),链接lib ...

  6. 禁用ngen版本的.NET Framework dll加载

    在调试时会发现出于性能考虑.NET Framework dll加载的都是ngen版本,比如:System.dll,实际加载System.ni.dll. 如果希望加载非ngen版本,可以设置系统环境变量 ...

  7. 未能从程序集 C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Data.Entity.Build.Tasks.dll 加载任务“EntityClean”

    问题: 未能从程序集 C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Data.Entity.Build.Tasks.dll 加载任务“Entity ...

  8. 利用dll加载漏洞实现远程代码执行

    微软的“不安全dll加载”漏洞涉及Windows XP至Windows 7等多个版本的操作系统.由于Windows存在加载未指明完整路径的dll文件的机制,可能导致用户在使用第三方软件.玩游戏.听音乐 ...

  9. HTTP 筛选器 DLL C:\Windows\Microsoft.Net\Framework\v4.0.30319\aspnet_filter.dll 加载失败。数据是错误。

    今天在一台win2003的云主机上,安装.net 4.0时,所有的网站都打不开了.打开事件查看器,发现以下错误: HTTP 筛选器 DLL C:\Windows\Microsoft.Net\Frame ...

  10. dll加载过程全局变量会先初始化

    在一个生成dll的工程中看到一个文件只有一句全局变量初始化的代码,很好奇为什么这句代码在dll加载的时候就会执行,因此断点调试发现 __declspec(noinline) BOOL __cdecl ...

随机推荐

  1. ueditor .net版本上传图片功能配置

    1.官网下载 UEditor .Net最新版:官方网址:http://ueditor.baidu.com/website/download.html#ueditor   UTF-8版 和GBK版选择疑 ...

  2. 调度系统任务创建---创建一个JoinTrigger的依赖任务(五)

    有时候我们需要创建一个任务,这个任务有多个下游任务,在所有下游任务执行成功后再触发一个join操作. 这种场景可以使用JoinTrigger的触发器来实现. 该场景对应的拓扑结构如下: 该触发器的详细 ...

  3. PHP Fatal Error: call to undefined function mysql_connect() [duplicate]

    You shouldn't use mysql_* functions to start with. They are deprecated as of PHP 5.5. Use mysqli or ...

  4. Dictionary<k,v>键值对的使用

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Dict ...

  5. java内存划分

    运行时数据区域 Java虚拟机在执行Java的过程中会把管理的内存划分为若干个不同的数据区域.这些区域有各自的用途,以及创建和销毁的时间,有的区域随着虚拟机进程的启动而存在,而有的区域则依赖线程的启动 ...

  6. 优秀开发人员网站推荐。——Arvin

    常用论坛汇总:智能车制作论坛:http://www.znczz.com/中国电子网:http://www.21ic.com/爱板网:http://www.eeboard.com/电子发烧友:http: ...

  7. RabbitMQ之入门

    生成者: #coding:utf-8 import sys import pika credentials=pika.PlainCredentials("guest"," ...

  8. Apache Commons BeanUtils

    http://commons.apache.org/proper/commons-beanutils/javadocs/v1.9.2/apidocs/org/apache/commons/beanut ...

  9. 有关Fragment的知识点

    关于判断Fragment是否可见,可以尝试参考使用Fragment中的两个方法: final boolean isHidden() Return true if the fragment has be ...

  10. T-SQL、JET SQL、PL-SQL

    数据库分为网状.层状.关系.对象四种类型,目前的数据库一般都是属于关系数据库(包括MYSQL和SQL SERVER),网状.层状基本上已成历史,对象类型尚未普及. SQL 语言是有 ANSI 标准的. ...