2011-09-24 3 views
1

다음 http 핸들러에서 다음 오류가 발생합니다. 다른 ashx 파일이 작동 중입니다. 더 많은 정보가 필요하면 ashx 오류 http 처리기

Server Error in '/einUsername' Application. 

Parser Error 

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Could not create type 'WebApplication18.Handler1'. 

Source Error: 


Line 1: <%@ WebHandler Language="C#" CodeBehind="Handler.ashx.cs" Class="WebApplication18.Handler1" %> 

Source File: /einUsername/Handler.ashx Line: 1 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 

코드 ... 말해

using System; 
using System.IO; 
using System.Text; 
using System.Net; 
using System.Web; 

public partial class csIPNexample : System.Web.UI.Page 
{ 
    protected void Page_Load(object sender, EventArgs e) 
    { 

     // logging ipn messages... be sure that you give write 
     // permission to process executing this code 
     string logPathDir = ResolveUrl("Messages"); 
     string logPath = string.Format("{0}\\{1}.txt", 
         Server.MapPath(logPathDir), DateTime.Now.Ticks); 
     File.WriteAllText(logPath, "hi"); 
     // 

    } 
} 

답변

1

오류 정보의 클래스 그러나 당신이 제공 한 코드 "csIPNexample이", "WebApplication18.Handler1"입니다 . 올바른 코드를 게시 했습니까?

+0

예, http://aspspider.net/einUsername%5cHandler1.ashx // ASP .NET C# ... 공공 부분 클래스 Handler1 : System.Web.UI.Page { 보호 무효를 Page_Load (개체를 보낸 사람 , EventArgs e) { // 로깅 ipn 메시지 ...이 코드를 실행하는 과정에서 // 권한을 지정해야합니다. string logPathDir = ResolveUrl ("Messages"); 문자열 logPath = string.Format ("{0} \\ {1} .txt", Server.MapPath (logPathDir), DateTime.Now.Ticks); File.WriteAllText (logPath, "hi"); // } } – einUsername

관련 문제