using System.Web;包含IHttpHandler这个接口可是 在C#项目里 引用using System.Web; 就不包含这个接口了然后程序不能编译 就没法生成.dll文件了
using System.Web;namespace HandlerExample
{
public class MyHttpHandler : IHttpHandler
{
// Override the ProcessRequest method.
public void ProcessRequest(HttpContext context)
{
context.Response.Write("<H1>This is an HttpHandler Test.</H1>");
context.Response.Write("<p>Your Browser:</p>");
context.Response.Write("Type: " + context.Request.Browser.Type + "<br>");
context.Response.Write("Version: " + context.Request.Browser.Version);
} // Override the IsReusable property.
public bool IsReusable
{
get { return true; }
}
}
}这段代码是MSDN上考下来的 应该没错误吧 大家 试试 建个类库 生成.dll文件试试
using System.Web;namespace HandlerExample
{
public class MyHttpHandler : IHttpHandler
{
// Override the ProcessRequest method.
public void ProcessRequest(HttpContext context)
{
context.Response.Write("<H1>This is an HttpHandler Test.</H1>");
context.Response.Write("<p>Your Browser:</p>");
context.Response.Write("Type: " + context.Request.Browser.Type + "<br>");
context.Response.Write("Version: " + context.Request.Browser.Version);
} // Override the IsReusable property.
public bool IsReusable
{
get { return true; }
}
}
}这段代码是MSDN上考下来的 应该没错误吧 大家 试试 建个类库 生成.dll文件试试
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货