2
我从以下http处理程序中得到“byte [] param = [...]”的错误。其他ashx文件正在工作。告诉我,如果你需要更多的信息...ashx错误http处理程序2
请求不可用在这方面
说明:在当前Web请求的执行过程中发生未处理的异常。请查看堆栈跟踪以获取有关该错误的更多信息以及源代码的位置。
异常详细信息:System.Web.HttpException:请求不可用在这方面
public class Handler1 : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World");
//Post back to either sandbox or live
string strSandbox = "https://www.sandbox.paypal.com/cgi-bin/webscr";
string strLive = "https://www.paypal.com/cgi-bin/webscr";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strSandbox);
//Set values for the request back
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
System.Web.UI.Page pa = new System.Web.UI.Page();
//HERE>HERE>HERE>HERE>
byte[] param = pa.Request.BinaryRead(HttpContext.Current.Request.ContentLength);
string strRequest = Encoding.ASCII.GetString(param);
strRequest += "&cmd=_notify-validate";
req.ContentLength = strRequest.Length;