using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
/**//// ﹤summary﹥
/// Employee 的摘要说明
/// ﹤/summary﹥
[Serializable]
public class Employee:ISerializable
{
public int EmpId=100;
public string EmpName="刘德华";
[NonSerialized]
public string NoSerialString = "NoSerialString-Test";
public Employee()
{
//
<SPAN style="WHITE-SPACE: pre"> </SPAN>// TODO: 在此处添加
构造函数逻辑
<SPAN style="WHITE-SPACE: pre"> </SPAN>//
}
private Employee(SerializationInfo info, StreamingContext ctxt)
{
<SPAN style="WHITE-SPACE: pre"> </SPAN>EmpId = (int)info.GetValue("EmployeeId", typeof(int));
<SPAN style="WHITE-SPACE: pre"> </SPAN>EmpName = (String)info.GetValue("EmployeeName",typeof(string));
<SPAN style="WHITE-SPACE: pre"> </SPAN>//NoSerialString = (String)info.GetValue("EmployeeString",typeof(string));
}
public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
{
<SPAN style="WHITE-SPACE: pre"> </SPAN>info.AddValue("EmployeeId", EmpId);
<SPAN style="WHITE-SPACE: pre"> </SPAN>info.AddValue("EmployeeName", EmpName);
<SPAN style="WHITE-SPACE: pre"> </SPAN>//info.AddValue("EmployeeString", NoSerialString);
}
}