62,254
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Runtime.InteropServices;
public partial class Test6 : System.Web.UI.Page
{
[DllImport("kernel32.dll")]
static extern IntPtr LoadLibrary(string lpFileName);
[DllImport("kernel32.dll")]
static extern IntPtr GetProcAddress(IntPtr hModule, string lpProcName);
[DllImport("kernel32", EntryPoint = "FreeLibrary", SetLastError = true)]
static extern bool FreeLibrary(IntPtr hModule);
protected void Page_Load(object sender, EventArgs e)
{
string file = Server.MapPath("./bin/") + "rzutil.dll";
Response.Write(file);
IntPtr module = LoadLibrary(file);
if (module == IntPtr.Zero)
{
Response.Write("load Fialed");
}
else
{
Response.Write("load success");
}
}
}