Public Function HTMLDecode(ByVal strHtmlCode As System.String) As System.String
        If Not IsDBNull(strHtmlCode) And Not IsNothing(strHtmlCode) Then
            strHtmlCode = Replace(strHtmlCode, "<BR> ", Chr(10))
            strHtmlCode = Replace(strHtmlCode, "</P><P> ", Chr(10) & Chr(10))
            strHtmlCode = Replace(strHtmlCode, "&#39;", Chr(39))
            strHtmlCode = Replace(strHtmlCode, "&quot;", Chr(34))
            strHtmlCode = Replace(strHtmlCode, "&nbsp;", Chr(32))
            strHtmlCode = Replace(strHtmlCode, "&#39;", "'") '替换单引号
            strHtmlCode = Replace(strHtmlCode, "&lt;", "<")
            strHtmlCode = Replace(strHtmlCode, "&gt;", ">")
            strHtmlCode = strHtmlCode.Replace("&amp;", "&")
            HTMLDecode = strHtmlCode
        End If
    End Function

解决方案 »

  1.   

    Public void HTMLDecode(ByVal strHtmlCode As System.String) As System.String  ==>这个是什么意思?具体应该写public void 方法名(string aaa,int bbb )数据类型+空格+参数名,这里自己写
    {
            If !IsDBNull(strHtmlCode) && !IsNothing(strHtmlCode)
    {
       strHtmlCode = Replace(strHtmlCode, "<BR> ", Chr(10))
                strHtmlCode = Replace(strHtmlCode, "</P><P> ", Chr(10) & Chr(10))
                strHtmlCode = Replace(strHtmlCode, "&#39;", Chr(39))
                strHtmlCode = Replace(strHtmlCode, "&quot;", Chr(34))
                strHtmlCode = Replace(strHtmlCode, "&nbsp;", Chr(32))
                strHtmlCode = Replace(strHtmlCode, "&#39;", "'") '替换单引号
                strHtmlCode = Replace(strHtmlCode, "&lt;", "<")
                strHtmlCode = Replace(strHtmlCode, "&gt;", ">")
                strHtmlCode = strHtmlCode.Replace("&amp;", "&")
                HTMLDecode = strHtmlCode
            
    }
    }
      

  2.   

    public string HTMLDecode(string strHtmlCode)
    {
      if (strHtmlCode!=String.Empty && strHtmlCode!=String.Empty)
      {
        strHtmlCode = strHtmlCode.Replace("<BR> ","\n");
        ……………………
      }
    }
      

  3.   

    可以用reflector加上插件弄;
    public string HTMLDecode(string strHtmlCode)
    {
        string text1;
        if (!Information.IsDBNull(strHtmlCode) & !Information.IsNothing(strHtmlCode))
        {
            strHtmlCode = Strings.Replace(strHtmlCode, "<BR> ", "\n", 1, -1, CompareMethod.Binary);
            strHtmlCode = Strings.Replace(strHtmlCode, "</P><P> ", "\n\n", 1, -1, CompareMethod.Binary);
            strHtmlCode = Strings.Replace(strHtmlCode, "&#39;", "'", 1, -1, CompareMethod.Binary);
            strHtmlCode = Strings.Replace(strHtmlCode, "&quot;", "\"", 1, -1, CompareMethod.Binary);
            strHtmlCode = Strings.Replace(strHtmlCode, "&nbsp;", " ", 1, -1, CompareMethod.Binary);
            strHtmlCode = Strings.Replace(strHtmlCode, "&#39;", "'", 1, -1, CompareMethod.Binary);
            strHtmlCode = Strings.Replace(strHtmlCode, "&lt;", "<", 1, -1, CompareMethod.Binary);
            strHtmlCode = Strings.Replace(strHtmlCode, "&gt;", ">", 1, -1, CompareMethod.Binary);
            strHtmlCode = strHtmlCode.Replace("&amp;", "&");
            text1 = strHtmlCode;
        }
        return text1;
    }
      

  4.   

    char(39),char(34),char(32) 是什么?
      

  5.   

    --Information 也没有啊!!
    哎,有没有能直接用的???
      

  6.   

    Public void HTMLDecode(ByVal strHtmlCode As System.String) As System.String  ==>这个是什么意思?具体应该写public void 方法名(string aaa,int bbb )数据类型+空格+参数名,这里自己写
    {
            If !IsDBNull(strHtmlCode) && !IsNothing(strHtmlCode)
    {
       strHtmlCode = Replace(strHtmlCode, "<BR> ", Chr(10));
                strHtmlCode = strHtmlCode.Replace("参数1","参数2");参数1:要操作的字符串或字符串变量,参数2,要替换的“字符串或字符串变量”
                //........
                HTMLDecode = strHtmlCode;
            
    }
    }
    你要问chr(32)。。是什么,这要问你自己,你要实现什么功能,语法就是这样,
      

  7.   

    --正确答案是这样吗?
       public  String HTMLDecode(String strHtmlCode) 
       { 
       if (strHtmlCode!=String.Empty) 
       { 
    strHtmlCode = strHtmlCode.Replace("<BR>","\n");
    strHtmlCode = strHtmlCode.Replace("</P><P>","\n\n");
    strHtmlCode = strHtmlCode.Replace("&#39;", "'"); 
    strHtmlCode = strHtmlCode.Replace("&quot;", "\""); 
    strHtmlCode = strHtmlCode.Replace("&nbsp;", " "); 
    strHtmlCode = strHtmlCode.Replace("&#39;", "'"); 
    strHtmlCode = strHtmlCode.Replace("&lt;", "<"); 
    strHtmlCode = strHtmlCode.Replace("&gt;", ">"); 
    strHtmlCode = strHtmlCode.Replace("&amp;", "&"); 
      return strHtmlCode; 
       }
    return null;
       }--我马上接贴,给分!谢谢大家提醒!
      

  8.   

    不对,后面应该是
    if()
    {
    ......return strHtmlCode;
    }else
    {
    ....return null;
    }