注銷(xiāo)

          注銷(xiāo)

            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            112 隨筆 :: 7 文章 :: 18 評(píng)論 :: 0 Trackbacks
          string DllPath = Application.StartupPath + @"\someDLL.dll";
          System.Reflection.Assembly assmble = System.Reflection.Assembly.LoadFile(DllPath);
          Type tmpType = assmble.GetType("someDLL.ClassA");
          System.Reflection.MethodInfo tmpM = tmpType.GetMethod("Add");
          object tmpobj = assmble.CreateInstance("someDLL.ClassA");
          int i = (int)tmpM.Invoke(tmpobj, new object[]{2,3});

          ----------ClassA的定義--------------------
          using System;

          namespace someDLL
          {
          /// <summary>
          /// ClassA 的摘要說(shuō)明。
          /// </summary>
          public class ClassA
          {
          public ClassA()
          {
          //
          // TODO: 在此處添加構(gòu)造函數(shù)邏輯
          //
          }

          public int Add(int a, int b)
          {
          return a+b;
          }
          }
          }
          posted on 2006-11-28 15:48 注銷(xiāo)..... 閱讀(623) 評(píng)論(1)  編輯  收藏 所屬分類(lèi): .net摘要

          評(píng)論

          # re: 動(dòng)態(tài)加載DLL 2011-09-03 17:22
          沒(méi)看懂  回復(fù)  更多評(píng)論
            

          主站蜘蛛池模板: 呼伦贝尔市| 元谋县| 赤水市| 枝江市| 镇宁| 高邑县| 开鲁县| 吉水县| 黎川县| 固阳县| 阿拉善右旗| 尚志市| 通榆县| 彰化市| 阳春市| 阿巴嘎旗| 金秀| 东乌珠穆沁旗| 朔州市| 兴义市| 通化县| 桑植县| 大埔区| 灌南县| 镇巴县| 盐山县| 芜湖县| 商城县| 涪陵区| 白玉县| 象州县| 望谟县| 色达县| 云安县| 永丰县| 乡宁县| 贡嘎县| 石首市| 平乡县| 昭通市| 招远市|