日期:2014-05-17 浏览次数:20808 次
using System.Runtime.InteropServices;
public sealed class Dll123{
[DllImport("D:\123123\123.dll", EntryPoint = "1234")]
public static extern bool 1234(string a, int b);
}
Type type= System.Reflection.Assembly.LoadFile(@"D:\123123\123.dll").GetType("Lib.MyClass");
object obj = type.GetMethod("1234").Invoke(Activator.CreateInstance(type), new object[] { "abc", 123 });
bool result = Convert.ToBoolean(obj);