📌  相关文章
📜  将查询字符串添加到 url c# 代码示例

📅  最后修改于: 2022-03-11 14:49:04.456000             🧑  作者: Mango

代码示例1
string longurl = "http://somesite.com/news.php?article=1&lang=en";
var uriBuilder = new UriBuilder(longurl);
var query = HttpUtility.ParseQueryString(uriBuilder.Query);
query["action"] = "login1";
query["attempts"] = "11";
uriBuilder.Query = query.ToString();
longurl = uriBuilder.ToString();
// "http://somesite.com:80/news.php?article=1&lang=en&action=login1&attempts=11"