Let's say that I want to block the specific HTML code
<script async annoyingcode.js>
AnnoyingCodeHere
</script>
in a website in WebBrowserControl1
. I tried using WebClient1.DownloadFile("website.html", @"C:\BlockerWork")
, File.ReadAllText(@"C:\BlockerWork")
, String.Replace
, then WebBrowserControl1.DocumentStream
, but it simply takes too long to run and requires downloading all the time. Is there an easier way in C#?
You can skip the file operation by using WebClient1.DownloadString("website.html")