日期:2014-05-20 浏览次数:20792 次
private static Dictionary<string, string> GetValue(string url, string parm1, string parm2)
{
Dictionary<string, string> dic = new Dictionary<string, string>();
foreach (Match m in Regex.Matches(url, parm1 + @"=(?<value1>\w+)&" + parm2 + @"=(?<value2>\w+)"))
{
dic.Add(m.Groups["value1"].Value, m.Groups["value2"].Value);
}
return dic;
}
static void Main(string[] args)
{
string htmlurl = @"http://localhost:2222/News#!http://localhost:2222/News/?IsG=1&gid=11";
Dictionary<string, string> dic = GetValue(htmlurl, "IsG", "gid");
String file_name = "C:\\test.xls";
}