So essentially here is what i am trying to do, i want to save the whole html source text into a string, there i will be checking if it contains myvar. I have seen many other topics saying how to do this, but i tried them and end up with errors, i either enter a break state when i use .load("example.com"); or the string will end up containing the URL and not the actual HTML code.
Here is my code:
string myString = "Pastebin";
HtmlAgilityPack.HtmlDocument page = new HtmlAgilityPack.HtmlDocument();
page.Load("https://pastebin.com");
string text = page.DocumentNode.OuterHtml;
if (text.Contains(myString))
{
MessageBox.Show("Yay!\n Match!");
Instance = this;
InitializeComponent();
timer1.Start();
}
else
{
MessageBox.Show("Error...\nThe Var Doesnt match");
Application.Exit();
}
}
Result:
Using .load("example.com"); The application enters a break state. using .loadhtml("example.com"); The application stores the URLand Not the HTML