c#程序中访问web服务时,传的数据到服务器端得到的字符串含有乱码
c#程序如下:
 xmlEncode = HttpUtility.UrlEncode(xmlData,Encoding.GetEncoding("GBK"));
string paraData = "student=" + student + "&question=" + question + "&xmldata=" + xmlEncode;
            byte[] data = Encoding.GetEncoding("GBK").GetBytes(paraData);             
            HttpWebRequest r = (HttpWebRequest)HttpWebRequest.Create(callback);        
                  
            r.Method = "POST";
            r.ContentType = "application/x-www-form-urlencoded";
            r.ContentLength = data.Length;
            Stream sm = r.GetRequestStream();
            sm.Write(data, 0, data.Length);
            sm.Close();
大家帮帮忙 在线等