注册 登录
编程论坛 ASP.NET技术论坛

第一个asp.net一般处理程序,浏览器访问不到,各种出错

高逆水行舟 发布于 2017-03-30 11:21, 2995 次点击
程序代码:



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ASP01Handle
{
    /// <summary>
   
/// c01first 的摘要说明
   
/// </summary>
    public class c01first : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Write("<title>我爱广州小蛮腰~小蛮腰上太阳伤~~!</title>");
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}




<?xml version="1.0" encoding="utf-8"?>

<!--
  有关如何配置 应用程序的详细信息,请访问
  http://go.
  -->

<configuration>
    <system.web>
      <compilation debug="true" targetFramework="4.5" />
      <urlMappings enabled="true"><add url="~/c01first.ashx" mappedUrl ="~/c01first.ashx"/>
      </urlMappings>
      <httpRuntime targetFramework="4.5" />
    </system.web>

</configuration>


只有本站会员才能查看附件,请 登录
只有本站会员才能查看附件,请 登录
只有本站会员才能查看附件,请 登录
只有本站会员才能查看附件,请 登录
只有本站会员才能查看附件,请 登录
2 回复
#2
wube2017-07-04 17:26
看起来是IIS(Web Server)设置上的问题吧~跟ASP无关~
#3
wube2017-07-05 13:46
仔细看原来你是用VS内建的Web Server~
印象中有些目录是预设会被拒绝访问的~
1