Getting selected text from a webpage inside an iframe using asp.net c #?

I have a strange task. I need to load a webpage inside an iframe. And regardless of the text that I select inside the iframe, I need to get this because of the iframe. I am not allowed to use javascript. Is there a way to do this in asp.net c #?

+3
source share
1 answer

I agree that this is a strange task. I personally avoided situations like this, however, if this is what you need to do, this is how I will refer to it.

  • I recommend that you get a library called the Html Agility Pack
  • Add the link to HTMLAgilityPack.dll in your asp.net application.
  • URL- iframe, -,

    WebClient webClient = new WebClient();
    byte[] reqHTML;
    reqHTML = webClient.DownloadData("http://www.urltothesiteyouwant.com/path/");
    UTF8Encoding objUTF8 = new UTF8Encoding();
    string htmlOfSite = objUTF8.GetString(reqHTML);
    
  • Html Agility pack , .

, , . , , , , , , ​​..

.

+2

All Articles