首页  编辑  

从剪贴板中读取RTF格式的HTML信息

Tags: /C#/剪贴板/   Date Created:

if ( Clipboard . ContainsText( TextDataFormat . Html))

{

    MemoryStream vMemoryStream =

        Clipboard . GetData( "Html Format" ) as MemoryStream ;

   vMemoryStream . Position = 0 ;

    byte [] vBytes = new byte [vMemoryStream . Length];

   vMemoryStream . Read(vBytes, 0 , ( int )vMemoryStream . Length);

   textBox1 . Text = Encoding . UTF8 . GetString(vBytes);

}