Retrieving Selected Text from Webbrowser control in .net(C#)

前端 未结 4 2086
余生分开走
余生分开走 2020-12-05 11:06

I\'ve been trying to figure out how to retrieve the text selected by the user in my webbrowser control and have had no luck after digging through msdn and other resources, S

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-05 11:52

    I'm assuming you have a WinForms application which includes a control that opens a website.

    Check to see if you can inject/run JavaScript inside your webbrowser control. Using JavaScript, you would be able to find out what was selected and return it. Otherwise, I doubt the web browser control has any knowledge of what is selected inside it.

提交回复
热议问题