How should I search for and get a string from html files using c# in asp.net? This is the code:
private string getHtml(string key)
{
StreamReader f = new StreamReader("path");
string htmlTag = key;
string str = f.ReadToEnd().ToString();
Match m = Regex.Match(str, "<" + htmlTag + ">" + "(.*)" + "</" +
htmlTag + ">", RegexOptions.Singleline);
Console.WriteLine(m.Groups[0]);
return str;
}
See Question&Answers more detail:os