日期:2014-05-17 浏览次数:20549 次
string str=@"Proinfo.aspx?pid=466&cid=1001&imei=355815042032336";
string pattern=@"(?i)(\w+)=([\w]+)";
Dictionary<string,string> dic=new Dictionary<string,string>();
foreach(Match m in Regex.Matches(str, pattern))
{
dic.Add(m.Groups[1].Value,m.Groups[2].Value);//dic格式就是这种(key=pid,Value=466)
}
/*
pid 466
cid 1001
imei 355815042032336
*/