扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:朱先忠编译 来源:天极开发 2007年11月6日
关键字: Windows
"UPDATE tbl_basket SET quantity = " + quantity.Text + " WHERE user_id = " + user_id; |
UPDATE tbl_basket SET quantity = 6 WHERE user_id = 230; |
" 1 WHERE 1 = 1; DROP tbl_users; --" |
UPDATE tbl_basket SET quantity = 1 WHERE 1 = 1; DROP tbl_users; -- WHERE user_id =; |
protected void shopBasketCheckout_OnServerClick(object source,EventArgs e) { string postData = ""; postData += "currency_code=GBP"; postData += "&cmd=_cart"; postData += "&business=youremailaddress@yourdomain.net"; postData += "&upload=1"; postData += "&cancel_return=www.davidmillington.net"; DataTable dtBasket = getBasketDt(); double total = 0.00; for(int i = 0; i < dtBasket.Rows.Count; i++) { postData += "&item_name_" + (i + 1) + "=" + dtBasket.Rows[i]["name"]; postData += "&quantity_" + (i + 1) + "=" + dtBasket.Rows[i]["quantity"]; postData += "&amount_" + (i + 1) + "=" + Convert.ToDouble(dtBasket.Rows[i]["price"]); total += (Convert.ToDouble(dtBasket.Rows[i] ["price"]) * Convert.ToInt32(dtBasket.Rows[i]["quantity"])); if(i == dtBasket.Rows.Count - 1) { postData += "&shipping_" + (i + 1) + "=" + calcDeliveryCost(total); } else { postData += "&shipping_" + (i + 1) + "=0.00"; } postData += "&shipping2_" + (i + 1) + "=0.00"; postData += "&handling_" + (i + 1) + "=0.00"; } postData += "&handling=" + calcDeliveryCost(total); byte[] data = Encoding.ASCII.GetBytes(postData); HttpWebRequest ppRequest = (HttpWebRequest) WebRequest.Create("https://www.paypal.com/cgi-bin/webscr");; ppRequest.Method = "POST"; ppRequest.ContentType = "application/x-www-form- urlencoded"; ppRequest.ContentLength = data.Length; //发送 Stream ppStream = ppRequest.GetRequestStream(); ppStream.Write(data, 0, data.Length); ppStream.Close(); //接收 HttpWebResponse ppResponse = (HttpWebResponse)ppRequest.GetResponse(); StreamReader sr = new StreamReader(ppResponse.GetResponseStream()); string strResult = sr.ReadToEnd(); sr.Close(); //输出到屏幕 Response.Clear(); Response.Write(strResult); Response.End(); } |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者