日期:2014-05-17 浏览次数:20517 次
<UrlRewrite> <Rule Look="word-([0-9]+).aspx" Send="default.aspx?classid=0&id=$1" /> <Rule Look="word-([0-9]+)-([0-9]+).aspx" Send="default.aspx?classid=0|$1&id=$2" /> </UrlRewrite>
string content = "default.aspx?classid=0&id=10"; System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(@"(?<=&id=)[\d]+"); System.Text.RegularExpressions.Match m = reg.Match(content); MessageBox.Show("word-"+m.Value+".aspx");
------解决方案--------------------
把Look的([0-9]+)和Send的$对调,Send的&改为&,再Replace