如何在C#中为URL构建查询字符串?
&
StringBuilder SB = new StringBuilder();if (NeedsToAddParameter A) {
SB.Append("A="); SB.Append(HttpUtility.UrlEncode("TheValueOfA")); }if (NeedsToAddParameter B) {
if (SB.Length>0) SB.Append("&");
SB.Append("B="); SB.Append(HttpUtility.UrlEncode("TheValueOfB")); }}
喵喔喔
随时随地看视频慕课网APP