日期:2014-05-18  浏览次数:20471 次

|M| 一个网上银行支付的接口,这是一个在页面中做的,如何把他改为后台执行
<form   name= "frm "   method= "post "   action= "https://www.99bill.com/webapp/receiveMerchantInfoAction.do ">
                        <input   id= "merchant_id "   type= "hidden "   runat= "server ">
                        <input   id= "orderid "   type= "hidden "   runat= "server ">
                        <input   id= "amount "   type= "hidden "   runat= "server ">
                        <input   id= "currency "   type= "hidden "   runat= "server ">
                        <input   id= "isSupportDES "   type= "hidden "   runat= "server ">
                        <input   id= "mac "   type= "hidden "   runat= "server ">
                        <input   id= "merchant_url "   type= "hidden "   runat= "server ">
                        <input   id= "pname "   type= "hidden "   runat= "server ">
                        <input   id= "commodity_info "   type= "hidden "   runat= "server ">
                        <input   id= "merchant_param "   type= "hidden "   runat= "server ">
                        <input   id= "pemail "   type= "hidden "   runat= "server ">
                        <input   id= "pid "   type= "hidden "   runat= "server ">
                        <input   name= "payby99bill "   type= "image "   src= "http://www.99bill.com/download/pay_button/99bill_buy_b.gif "
                                value= "快钱支付 ">
                </form>
就像上面的这些东西
我如何在btnPay_OnClick()
这里来写这些东西而不要上面的那些html控件
也就是说用一个asp:Button和后台代码来代替上面的所有内容

谢谢

------解决方案--------------------
以POST方式提交
(http://www.z6688.com/info/35003-1.htm)
string url = "网址 ";
httpwebrequest req = (httpwebrequest)webrequest.create(url);
string s = "要提交的数据 ";
byte[] requestbytes = system.text.encoding.ascii.getbytes (logininfo);
req.method = "post ";
req.contenttype = "application/x-www-form-urlencoded ";
req.contentlength = reques