.net 正则获取url参数

  public static string GetParams(string paramName)
        {
            var url = "http://fdsfs.com/Home/Index?corp=ExFresh&aa=bb";
            var signedUrl = Regex.Match(url, paramName + "=([^&]*)");
            return signedUrl.Groups[1].ToString();
        }

 

posted @ 2017-02-08 15:33  直钩钓鱼  阅读(430)  评论(0)    收藏  举报