简单写了个C# 以正则获得URL地址栏参数的方法

        public static string GetPara(string url, string name)
        {
            Regex reg = new Regex(@"(?:^|\?|&)" + name + "=(?<VAL>.+?)(?:&|$)");
            Match m = reg.Match(url);
            return m.Groups["VAL"].ToString(); ;
        }

 

相关文章:

  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2021-09-19
猜你喜欢
  • 2022-01-10
  • 2021-08-04
  • 2021-11-18
  • 2021-06-22
  • 2021-08-29
  • 2021-11-20
  • 2021-06-01
相关资源
相似解决方案