日期:2014-05-17 浏览次数:20561 次
<form name="paypal" target="_blank" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick"/>
<input type="hidden" name="notify_url" value="http://www.xxx.com/paypal/success.aspx"/>
<input type="hidden" name="business" value="wj02w0_1314675989_biz@126.com"/>
<input type="hidden" name="item_name" value="order information"/>
<input type="hidden" name="amount" value="10.00"/>
<input type="hidden" name="currency_code" value="USD"/>
<input type="hidden" name="on0" value="customerId"/>
<input type="hidden" name="os0" value="stephen"/>
<input type="hidden" name="on1" value="address"/>
<input type="hidden" name="os1" value="shanghai china"/>
<input type="hidden" name="return" value="http://www.xxxx.com/paypal/ok.aspx"/>
<input type="hidden" name="cancel_return" value="http://www.xxx.com/paypal/cacel.aspx"/>
<input name="button1" type="button" value="Go to Paypal" onclick="javaScript:this.form.submit();"/>
</form>
protected void Page_Load(object sender, EventArgs e)
{
HttpCookie cookie = new HttpCookie("PaypalInfoErr");
DateTime dt = DateTime.Now;//定义时间对象
TimeSpan ts = new TimeSpan(1, 0, 0, 0);//cookie有效作用时间,具体查msdn
cookie.Expires = dt.Add(ts);//添加作用时间
cookie.Values.Add("ppItem", DateTime.Now.ToString());
Response.AppendCookie(cookie);//确定写入cookie
}
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Cookies["PaypalInfoErr"] != null)
{
Response.Write("<br/>PaypalInfoErr不为空");
Response.Write("<br/>" + Request.Cookies["PaypalInfoErr"]["ppItem"].ToString());
}
}