当前位置: 代码迷 >> 综合 >> 腾讯微博SDK C#版本 发微博时有中文报check sign error的解决办法
  详细解决方案

腾讯微博SDK C#版本 发微博时有中文报check sign error的解决办法

热度:72   发布时间:2023-12-09 23:28:04.0
修改 synchttp.cs
131行开始 即对content进行了特别处理 进行urldecode
即可发中文了

                foreach (Parameter param in listParams)
                {
                    if (param.Name != "content")
                    {
                        string formitem = string.Format(formdataTemplate, param.Name, param.Value);
                        byte[] formitembytes = Encoding.UTF8.GetBytes(formitem);
                        memStream.Write(formitembytes, 0, formitembytes.Length);
                    }
                    else
                    {
                        string formitem = string.Format(formdataTemplate, param.Name, System.Web.HttpUtility.UrlDecode(param.Value));
                        byte[] formitembytes = Encoding.UTF8.GetBytes(formitem);
                        memStream.Write(formitembytes, 0, formitembytes.Length);

                    }

                }


感谢SDK作者的指导

  相关解决方案