;html">需进行编码的html</param>
/// <param name="e">进行编码的类</param>
/// <returns>返回编码以后的值</returns>
public string HtmlDecode(string html, Encoding e)
{
string htmlDecoded = HttpUtility.HtmlDecode(html);
byte[] htmlDecodedBytes = Encoding.Unicode.GetBytes(htmlDecoded);
char[] htmlDecodedChars = Encoding.Unicode.GetChars(htmlDecodedBytes);
htmlDecodedBytes = new byte[htmlDecodedChars.Length];
for(int i = 0; i < htmlDecodedChars.Length; i++)
{
htmlDecodedBytes[i] = (byte)htmlDecodedChars[i];
}
htmlDecoded = e.GetString(htmlDecodedBytes);
return htmlDecoded;
}
/// <summary>
/// html编码
/// </summary>
/// <param name="html">需进行编码的html</param>
/// <returns>返回编码以后的值</returns>
public string HtmlDecode(string html)
{
return this.HtmlDecode(html, HtmlEncoding);
}
}
}