public static string GetInputControlsNameAndValueInPage(string strPage)
{
string strRegExPatten = "<s*input.*?names*=s*"(?<Name>.*?)".*?values*=s*"(?<Value>.*?)".*?>";
Regex reg = new Regex(strRegExPatten, RegexOptions.Multiline);
MatchCollection mc = reg.Matches(strPage);
string strTemp = string.Empty;
foreach (Match m in mc)
{
strTemp = strTemp + m.Groups["Name"].Value + "=" + m.Groups["Value"].Value + "&";
}
int n = strTemp.Length;
strTemp = strTemp.Remove(n - 1);
return strTemp;
}
snippets |
February 3, 2012
Get Input Controls Name And Value In HTML Page
Category: Uncategorized |
Tags: and, controls, Expression, get, html, in, input, multiline, name, page, regex, regexoptions, regular, Value
Leave a Reply Cancel reply
You must be logged in to post a comment.