富文本二进制转换成string

 var explainString = Encoding.Unicode.GetString(list[0].KindExplain);
                if (explainString.IndexOf("\u003cimg") > -1)
                {
                    explainString =
                        explainString.Substring(0, explainString.IndexOf("\u003cimg") + 5) + "  src=\"" + Request.Url.Host + ":" + Request.Url.Port +explainString.Substring(explainString.IndexOf("src=") + 5, explainString.IndexOf("\"", explainString.IndexOf("src=") + 7) + 1 - (explainString.IndexOf("src=") + 5)) + " " + explainString.Substring(explainString.IndexOf("/\u003e", explainString.IndexOf("\u003cimg") + 5), explainString.Length - explainString.IndexOf("/\u003e", explainString.IndexOf("\u003cimg") + 5));
                }
                return Json(explainString, JsonRequestBehavior.AllowGet);

   若是有图片,填上ip地址和端口号

posted @ 2017-10-13 14:04  雷雨天的雷胖子  阅读(337)  评论(0编辑  收藏  举报