反射调用DLL

来源:互联网 发布:深圳市蜂鸟软件科技 编辑:程序博客网 时间:2024/06/03 06:50
            Assembly ass = Assembly.UnsafeLoadFrom("BarcodeLib.dll");            Type type = ass.GetType("BarcodeLib.Barcode");            Type types = ass.GetType("BarcodeLib.TYPE");            pictureBox1.Image = type.GetMethod("DoEncode", new Type[] { types, typeof(string), typeof(bool) }).Invoke(ass, new object[] { types.GetField("CODE11").GetValue(null), "123123213", true }) as Image;
0 0
原创粉丝点击