通过DLL的完整地址和className,获得Type的值 - GetTypeByDLLName

2017-02-26 15:48:33  访问(1487) 赞(0) 踩(0)


        /// <summary>
        /// 通过DLL的完整地址和className,获得Type的值 - GetTypeByDLLName
        /// </summary>
        /// <param name="dllFullName"></param>
        /// <param name="className"></param>
        /// <returns></returns>
        public static Type GetTypeByDLLName
            (
                string dllFullName, 
                string className
            )
        {
            Assembly ass = Assembly.LoadFrom(dllFullName);

            if (ass == null)
                return null;

            Type theResult = ass.GetType(className, false, true);

            if (theResult == null)
            {
                return null;
            }

            return theResult;
        }


标签:通过DLL的完整地址和className,获得Type的值 - GetTypeByDLLName 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)