ASCIIEncoding encoding = new ASCIIEncoding();string postData = "type=CVWeekly&html=" +strHtml + "&sign=" + strSign; byte[] data = encoding.GetBytes(postData); 1.strHtml是抓取網(wǎng)頁(yè)的源碼,其中有不少&字符,會(huì)導(dǎo)致Request接收不完整。2.抓取的網(wǎng)頁(yè)是gb2312,測(cè)試程序是控制臺(tái)應(yīng)用程序,post提交到的aspx也是gb2312編碼,開(kāi)始為解決&字符的問(wèn)題,用HttpUtility.UrlEncode編碼后提交,但接到時(shí)解碼,總是亂碼。
post提交html源碼該如何編碼?
鴻蒙傳說(shuō)
2018-09-14 08:06:55