开发者

How to read copied html text from clipboard with its html tags?

When a user selects and copies a text from a web page, I need to get that text with all the html tags included so that I can select some specific attributes etc.

Is it possible to read it from .NET ap开发者_运维问答plication?

thanks


The Clipboard.GetText method will retrieve HTML content from the clipboard:

var htmlData = System.Windows.Clipboard.GetText(System.Windows.TextDataFormat.Html);

You can check if the clipboard contains HTML with the Clipboard.ContainsText method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜