I am trying to make something that will enable all controls if a SubString in a WebBrowser matches a
SubString in a TextBox and if it does it will enable all controls, but I can’t seem to get it to work.
This is my current code:
string str = "www.google.com";
int pos = str.IndexOf(".") + 1;
int pos2 = str.LastIndexOf(".") - 4;
string str2 = str.Substring(pos, pos2);
if (webBrowser1.Url.AbsoluteUri.Substring(pos, pos2) == textBox1.Text.Substring(pos, pos2))
{
foreach (Control c in Controls)
{
c.Enabled = true;
}
}
Any and all help will be appreciated.
The
Uriclass is a wonderful thing.Or even simply: