截取URL字符串

来源:互联网 发布:河北农业大学网络课 编辑:程序博客网 时间:2024/05/29 08:30
String EntryPage=” http://localhost:1572/Visit/Index?Featured=20”
System.Text.RegularExpressions.Regex reg=new System.Text.RegularExpressions.Regex("Featured=([^&]+)");
Uri uri = new Uri(EntryPage);
System.Text.RegularExpressions.Match match = reg.Match(uri.Query);
AdvertisingID = match.Groups[1].Value;//获取到其中20的参数值
String EntryPage=” http://localhost:1572/Visit/Index?Featured=20”
System.Text.RegularExpressions.Regex reg=new System.Text.RegularExpressions.Regex("Featured=([^&]+)");
Uri uri = new Uri(EntryPage);
System.Text.RegularExpressions.Match match = reg.Match(uri.Query);
AdvertisingID = match.Groups[1].Value;//获取到其中20的参数值
0 0
原创粉丝点击