【发布时间】:2011-08-15 14:16:56
【问题描述】:
好像HttpContext.Request.Form中的ToString()被修饰了所以结果不一样 当直接在 NameValueCollection 上调用时从 ToString() 返回的那个:
NameValueCollection nameValue = Request.Form;
string requestFormString = nameValue.ToString();
NameValueCollection mycollection = new NameValueCollection{{"say","hallo"},{"from", "me"}};
string nameValueString = mycollection.ToString();
return "RequestForm: " + requestFormString + "<br /><br />NameValue: " + nameValueString;
结果如下:
RequestForm:say=hallo&from=me
NameValue:System.Collections.Specialized.NameValueCollection
如何获得“字符串 NameValueString = mycollection.ToString();”返回“say=hallo&from=me”?
【问题讨论】:
标签: c# .net asp.net asp.net-mvc-3