zoukankan      html  css  js  c++  java
  • c#内存中创建反射

    代码

      IWFP_SYS_Bytes mywfpbyte;
                                 
                                /**/
                                byte[] bin=null;
                                using (FileStream fs = new FileStream(filename, FileMode.Open))
                                {
                                    BinaryReader br = new BinaryReader(fs);
                                     bin = br.ReadBytes(Convert.ToInt32(fs.Length));
                                    fs.Close();
                                    br.Close();
                                }
                                Assembly vAssembly = Assembly.Load(bin);// Assembly.LoadFrom(filename);
                                 
                                System.Globalization.CultureInfo gcnull = null; 
                                object[] objnull = null;
                                Binder binull = null;
                                object vTemp = null;
                                object[] objParm = null;//传递的参数
                                AppDomain ad = AppDomain.CreateDomain("DLL Unload test");
    
                                vTemp = vAssembly.CreateInstance(Classname, true, BindingFlags.Default, binull, objParm, gcnull, objnull);
                                if (vTemp != null)
                                {
                                    mywfpbyte = (IWFP_SYS_Bytes)vTemp;
                                    mywfpbyte.DBtype = ConfigurationManager.AppSettings["DBtype"];
                                    mywfpbyte.PSQL = ConfigurationManager.AppSettings["PSQL"];
                                    mywfpbyte.WFPCon = WFPCon;
                                    isrun = 1;
                                   
                                    byte[] rebytes= mywfpbyte.WFP_SYS_BytesSQL(args, Param, mpath, myurl, out errorInfo);
                                       
                                    AppDomain.Unload(ad);
                                    mywfpbyte = null;
    
                                    return rebytes;
                                }
  • 相关阅读:
    css开发素材网址
    html5笔记(标签)
    cms实例笔记(二)
    ie 元素兼容性总结
    ps常用键
    视图适配
    JavaScript 全部介绍
    cmscp实例笔记
    Google proto buffer的安装/使用
    ntp时间同步服务器配置
  • 原文地址:https://www.cnblogs.com/cwfsoft/p/3442971.html
Copyright © 2011-2022 走看看