在做一个P2P,遇到一个问题,我通过SHA1加密后得出来的字符串中包含+,然后传给第三方平台时,+变成了空格。
以下是我的传参代码,不知道什么地方出现问题了,请帮忙看下,谢谢!
主要是下边2个注释的地方出现了问题
string mchnt_cd = "0001000F0342510"; string mchnt_txn_ssn = DateTime.Now.ToString("yyyyMMddHHmmss"); string user_id_from = m.ID.Value.ToString(); string mobile_no = m.Mobile.Trim(); string cust_nm = ""; string certif_id = ""; string email = ""; string city_id = ""; string parent_bank_id = ""; string bank_nm = ""; string capAcntNo = ""; string page_notify_url = "http://192.168.5.150:8900/member/bindend.aspx"; string back_notify_url = "http://192.168.5.150:8900/member/bindmyAccountcheck.aspx"; string q = back_notify_url + "|" + bank_nm + "|" + capAcntNo + "|" + certif_id + "|" + city_id + "|" + cust_nm + "|" + email + "|" + mchnt_cd + "|" + mchnt_txn_ssn + "|" + mobile_no + "|" + page_notify_url + "|" + parent_bank_id + "|" + user_id_from; string signature = new ssosign().signData(q);//这里是加密获得的字符串,是正确的 string url = "http://116.239.4.195:9056/jzh/webReg.action?"; url += "back_notify_url=" + back_notify_url + ""; url += "&bank_nm=" + bank_nm + ""; url += "&capAcntNo=" + capAcntNo + ""; url += "&certif_id=" + certif_id + ""; url += "&city_id=" + city_id + ""; url += "&cust_nm=" + cust_nm + ""; url += "&email=" + email + ""; url += "&mchnt_cd=" + mchnt_cd + ""; url += "&mchnt_txn_ssn=" + mchnt_txn_ssn + ""; url += "&mobile_no=" + mobile_no + ""; url += "&page_notify_url=" + page_notify_url + ""; url += "&parent_bank_id=" + parent_bank_id + ""; url += "&user_id_from=" + user_id_from + ""; url += "&signature=" + Server.UrlEncode(signature) + "";//这个参数中的+传到第三方服务器的时候变成了空格 Response.Redirect(url);