????? C# .NET ?? ????? ?? ???? asp.NET HTTP ?????? ?? ????? ???? ????

???? ?????? ???? ??????
???? ID: 308001 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
??? ?? ??????? ???? | ??? ?? ??????? ????

?? ????? ??

?? ??? ?? ??? ???? ????????? ???? ?? ?? ??????, ????? HTTP ?????? ????? ?? ??? ????? C# .NET ?? ????? ???? ????? ?? ???? ????????? ???? ?? ?? ???? ?????, ?????? ????, ?? ?????? ???????? ?????

???? ???????

?????? ??????????? ????

  1. Microsoft Visual Studio .NET ?????? ????? C# .NET, ??? ?? ?? ????? ????????? ????????? MyHandler ??? ??????
  2. ???? ?????? ?? ??? ??? ????System.web.dll????????
  3. ???? ?? ??? ????? directive ??????:
    using System.Web;
    					
  4. ???? SyncHandler.cs ?? ??? ?????, ?? ?? ???? ??????? ?? ?? ?????? ?? ??? ????????? ?????
  5. ImplementIHttpHandler???????? ??? ???? ???? ??????? ?? ??? ??? ????? ???? ?????:
    public class SyncHandler : IHttpHandler
    					
  6. ImplementIsReusable??? ??ProcessRequest?? ??? ????IHttpHandler???????? ??? ??????? ?? ???? ????????? ?????? ??, ?? ???? ?????????? ???IsReusable??? ?? ?????? pooled ???? ???
    public bool IsReusable
    {
       get {return false;}
    }
    
    public void ProcessRequest(HttpContext context)
    {
       context.Response.Write("Hello from custom handler.");
    }
    					
  7. ????????? ?? ??????? ?????

?????? ?????? ????

  1. ??? ?? ?????????? C:\Inetpub\Wwwroot ?????????? ?? ??????? ?????? ?? ??? ??????
  2. ?? ???? ?? ?????? ?????????? ??? ??? ??? ??? ?? subdirectory ?????? ??????? ?? ??? C:\Inetpub\Wwwroot\Handler\Bin ???
  3. C:\Inetpub\Wwwroot\Handler\Bin ?????????? ?? ???? ????????? Bin\Debug ?????????? ?? MyHandler.dll ?? ????????? ??????
  4. ??? ?????? ?????????? ?? ???? ??? ????????? ?? ??? ??? ??????? ???? ?? ???, ????? ????? ?? ???? ????:
    1. ??????? ???? ??????? ??????
    2. ?????? ?????????? ?? ????-????? ????, ?? ???? ??? ????? ???????.
    3. ????? ????????????????? ??,?????.
  5. ?????? ?? ??? ??? ????????? ?????? ????? ?? ???, ????? ????? ?? ???? ????? ?? ?????? ?? ??? ??? *.sync ????????? ?? ??? Aspnet_isapi.dll ????? ?????? ?????? ??? .sync ????? ?? ?????? ???? ??, ?? ?? ?????? ???? ?? ??? asp.NET, ??? ?? ?? asp.NET ?????? ??? ??? ????????? ???? ???
    1. ?????? ??? ????????? ?? ????-????? ????, ?? ???? ??????.
    2. ????? ????????????????? ??,configuration.
    3. ????? ????,add??? ??? ?????? ???????
    4. ????????????? ???????? ????? ???, ????? ?? ???? ????: Microsoft Windows 2000:
      C:\WINNT\Microsoft.NET\Framework\ <version#>\Aspnet_isapi.dll</version#>
      Microsoft Windows XP:
      C:\WINDOWS\Microsoft.NET\Framework\ <version#>\Aspnet_isapi.dll</version#>
    5. ????????????????? ????? ???, ??????.sync.
    6. ????????? ???? ?? ?????? ???? ?? ???? ????? ????? ????? ????? ??, ?? ???? ??? ????? ????OK??? ???? ?? ???????????? ????????? ?????? ?????/??????? ????????? ????? ?? ??????? ?? ??? ?? ..
    7. ????? ????,OK??? ???? ?? ???????????? ?? ??????????????????? ???????? ????? ????
  6. ??????? ???? ??????? ?? ??? ?????

?????? ?? ???????? ????

  1. C:\Inetpub\Wwwroot\Handler ?????????? ??? Web.config ??? ?? ??? ?? ????? ??????
  2. ????? ??? Web.config ??? ??????:
    <configuration>
       <system.web>
          <httpHandlers>
             <add verb="*" path="*.sync" type="MyHandler.SyncHandler, MyHandler" />
          </httpHandlers>
       </system.web>
    </configuration>
    						
    ??????????? = "*"??????? ?? ???, ???? ?? ?????? (?????? ?? ???, POST, HEAD, GET ?? ??? ???) ?? ????? ???? ?? ?? ?????? ?? ??????? ???? ?? ??? ?????? ?? instruct. ??? ?? ?? ?????? ???? POST ?????? ?? ??????? ???? ?? ??? ????? ???, ????????? ???? ?? ??? ?? ?????????? "POST" =.

    ??????? "*.sync" =???????, ?????? .sync ????????? ???? ??????? ?? ??? ??? ?? ??? ???? ???????? ?? ??????? ???? ?? ??? ?? instruct.

    ?????type="MyHandler.SyncHandler, MyHandler"??????? ??, ?? instruct ?????? ??? ??????????? ???? ?? ??? ?????? ?? ???????? ???? ??MyHandler.SyncHandler??? ?????, ?? ?? ???? ????? ???MyHandler????????

??????? ?? ??????? ????

?? ?????? ?? ??????? ?? ??? ??? ????? ???? ???? ?? ???????? ???? ?????? ??? ????? ??? ?????? ?? ??? ?????? ??? ????????? (http:// <computername>/Handler/Default.sync) ??? Default.sync ????? ?? ?????? ????? ????? ???????? ?? ??????? ???? ?????:</computername>
Hello from custom handler.
				

??????

HTTP handlers ?? ???? ??? ???????? ??????? ?? ??? Microsoft ???????? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
307985?????: asp.NET HTTP ??????? ?? HTTP ???????? ?? ??????

???

???? ID: 308001 - ????? ???????: 29 ??????? 2010 - ??????: 4.0
???? ???? ???? ??:
  • Microsoft ASP.NET 1.1
  • Microsoft ASP.NET 1.0
  • Microsoft Visual C# .NET 2003 Standard Edition
  • Microsoft Visual C# .NET 2002 Standard Edition
??????: 
kbconfig kbhowtomaster kbhttphandlers kbhttpruntime kbweb kbmt KB308001 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:308001

??????????? ???

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com