string url = "https://i.cnblogs.com/EditPosts.aspx?opt=1";
//key不区分大小
string key="opt";
分写:
Uri uri = new Uri(url);
string query = uri.Query;
NameValueCollection nvc = HttpUtility.ParseQueryString(query);
string value= nvc.Get(key);
连写:
HttpUtility.ParseQueryString((new Uri(url)).Query).Get(key);