string.IndexOf will return -1 if it can't find the string you're looking for, so this call:
_fAppContent.IndexOf("<html>")
Is returning -1 because it can't find
"<html>"
. Check that
_appBuffer
actually contains something, that
_fAppContent
actually contains something and that the search string you pass to
IndexOf
is in the correct case.