Using the following code I get a nice formatted string:
Request.QueryString.ToString
Gives me something like: &hello=worldµsoft=sucks
But when I use this code to clone the collection to another object (of the same type) I get the Type() back from the ToString() method instead.
System.Collections.Specialized.NameValueCollection variables = new System.Collections.Specialized.NameValueCollection(Request.QueryString);
if (!string.IsNullOrEmpty(variables["sid"]))
variables.Remove("sid");
Response.Write(variables.ToString());
Is there a tidier way to output it rather than looking and building the string manually?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…