| ASP.NET中“找不到指定模块”的解决办法 |
|
|
|
|
| 来源: 作者: 添加日期:2007-10-12 16:31:23 点击次数: |
|
public Delegate Invoke(String APIName,Type t) { IntPtr api = GetProcAddress(hLib, APIName); return (Delegate)Marshal.GetDelegateForFunctionPointer(api,t); } }
用下面代码进行调用
以下是引用片段: public delegate int Compile(String command, StringBuilder inf);//编译 DllInvoke dll = new DllInvoke(Server.MapPath(@"~/Bin/Judge.dll")); Compile compile = (Compile)dll.Invoke("Compile", typeof(Compile)); StringBuilder inf; compile(@“gcc a.c -o a.exe“,inf); //这里就是调用我的DLL里定义的Compile函数 |
|
| |