一个DLLIMPORT的问题,请求帮助
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.InteropServices;
/// <summary>
///DllImportExamplecs 的摘要说明
/// </summary>
public class DllImportExample
{
public DllImportExample()
{
//
//TODO: 在此处添加构造函数逻辑
//
}
[DllImport("user32.dll", EntryPoint = "MessageBox")]
public static extern int MessageBox(int hWnd, String strMessage, String strCaption, uint uiType);
public void test()
{
MessageBox(0, "您好,这是 PInvoke!", ".net", 0);
}
}
然后在前端页面调用test方法,在vs2008中运行用内置服务器打开页面可以正常调用test方法,MessageBox对话框也出来了,但是我用IIS站点的方式访问时却迟迟打不开页面,也不报错,就是页面很慢很慢打不开,我把
[DllImport("user32.dll", EntryPoint = "MessageBox")]
public static extern int MessageBox(int hWnd, String strMessage, String strCaption, uint uiType);
public void test()
{
MessageBox(0, "您好,这是 PInvoke!", ".net", 0);
}
这段代码注释掉,当然前端页面调用的地方也注释掉,用IIS就能访问页面,请问这是怎么回事?该如何解决,因为这样网站发布后一定也是打不开页面的。