反射呼叫DLL

世紀緣發表於2016-08-24
            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;

相關文章