zoukankan      html  css  js  c++  java
  • C# dll加载,抽象方法的使用

    抽象类! 

    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;
    }

  • 相关阅读:
    tomcat虚拟机配置
    日期时分秒毫秒+3位随机数
    springmvc action访问路径不带项目名
    nginx 配置模板
    AES加密
    spring-mvc里的 <mvc:resources> 及静态资源访问
    MySQL——事务(Transaction)
    mysql索引
    < aop:aspect>与< aop:advisor>的区别
    annotation-driven
  • 原文地址:https://www.cnblogs.com/zxs-onestar/p/5993084.html
Copyright © 2011-2022 走看看