在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
protected LosFormatter losFormatter = new LosFormatter(); protected override object LoadPageStateFromPersistenceMedium() { string key = Request.RawUrl + "__viewstate"; if (Session[key] != null) { object obj = null; using (System.IO.MemoryStream stream = (System.IO.MemoryStream)Session[key]) { stream.Seek(0, System.IO.SeekOrigin.Begin); obj = losFormatter.Deserialize(stream); } Session[key] = null; return obj; } return null; } protected override void SavePageStateToPersistenceMedium(object viewState) { string key = Request.RawUrl + "__viewstate"; System.IO.MemoryStream stream = new System.IO.MemoryStream(); losFormatter.Serialize(stream, viewState); stream.Flush(); Session[key] = stream; } |
请发表评论