HttpHandler 를 이해 하고 모든*.jpg 그림 에 텍스트 를 생 성 합 니 다.

1792 단어 HttpHandler
인터페이스 IHttpHandler 의 정 의 는 다음 과 같다.MyHttpHandler 5 라 는 이름 을 지 었 습 니 다.웹.config 에 있 는 system.web 노드 중 아래 와 같은 노드6-MyHttpHandlerTest 오른쪽 키 에 인용 을 추가 하고,항목 을 선택 하여 방금 컴 파일 한.dll 파일 7-Handler 1.aspx 를 실행 합 니 다.페이지 표시:HttpHandler 를 이용 하여 그림 에 클래스 를 추가 합 니 다.기본 값 은 Class.cs
 
interface IHttpHandler
{
void ProcessRequest(HttpContext ctx);
bool IsReuseable { get; }
입 니 다.aspx 페이지 를 새로 만 들 고 HyperLink 컨트롤 을 추가 합 니 다.그.cs 파일 에 코드 전송 값
 
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.SessionState;
namespace MyHttpHandler
{
public class Class1:IHttpHandler,IRequiresSessionState
{
#region IHttpHandler
public bool IsReusable
{
get { return true; }
}

public void ProcessRequest(HttpContext context)
{
context.Response.Write("handler ");
}
#endregion
}
}
을 추가 합 니 다.또한 웹.config 파일 에서 http Handlers 노드 를 다음 과 같이 바 꿔 야 합 니 다.

좋은 웹페이지 즐겨찾기