Append values to query string

后端 未结 8 1464
借酒劲吻你
借酒劲吻你 2020-11-28 20:32

I have set of URL\'s similar to the ones below in a list

  • http://somesite.com/backup/lol.php?id=1&server=4&location=us
  • http://somesite.com/news
8条回答
  •  时光取名叫无心
    2020-11-28 20:47

    Note you can add the Microsoft.AspNetCore.WebUtilities nuget package from Microsoft and then use this to append values to query string:

    QueryHelpers.AddQueryString(longurl, "action", "login1")
    QueryHelpers.AddQueryString(longurl, new Dictionary { { "action", "login1" }, { "attempts", "11" } });
    

提交回复
热议问题