Paste html from Clipboard

Paste html from Clipboard 可解决中文乱码问题。
MemoryStream ms = Clipboard.GetData("Html Format") as MemoryStream;
if (ms == null)
{
return;
}

ms.Position
= 0;
byte[] vBytes = new byte[ms.Length];
ms.Read(vBytes,
0, (int)ms.Length);

string strFullHtml = Encoding.UTF8.GetString(vBytes); // utf-8
posted @ 2011-06-11 22:11  把爱延续  阅读(577)  评论(0编辑  收藏  举报