The
documentation[
^] states:
Quote:
The zero-based index position of value if that string is found, or -1 if it is not. If value is String.Empty, the return value is 0.
int start = cinfo.IndexOf("<pre class="df-raw" id="registryData">");
int finish = cinfo.Substring(start).IndexOf("</pre>");
You are assuming that the text exists... To fix:
int start = cinfo.IndexOf("<pre class=\"df-raw\" id=\"registryData\">");
if (start >= 0)
{
int finish = cinfo.Substring(start).IndexOf("</pre>");
if (finish >= 0)
{
rtxtregistery.Text = cinfo.Substring(start, finish);
}
}