开发者

How do I paste richtext into a textbox?

I want to highlight some stuff on a web page and be able to paste it into a richtextbox in C# winforms. I want to then b开发者_如何学Pythone able to see the HTML code of what I had pasted. Is this possible?


This snippet will return a string containing the code. There is some header info at the top that you may want to parse out but it is pretty straight forward.

string html = Clipboard.GetData(DataFormats.Html).ToString();

You will be able to populate that into a text box or richtext box however you like.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜