BinaryFormatter formatter = new BinaryFormatter();
using (MemoryStream m = new MemoryStream())
{
formatter.Serialize(m, list);
StreamReader sr = new StreamReader(m);
HiddenField1.Value = sr.ReadToEnd();
}
我得到 HiddenField1.Value 的空白值。不确定我在做什么是可能的?列表肯定已填充(is a List<T>)