PersonInfo.vb
资源名称:08.zip [点击查看]
上传用户:ynjin1970
上传日期:2014-10-13
资源大小:6438k
文件大小:2k
源码类别:
中间件编程
开发平台:
Visual C++
- '自定义人员信息类,用于发送和接受
- <Serializable()> Public Class Person '注意如果使用BinaryMessageFormatter的话,必须是可序列化的,即<Serializable()> 是必须的
- Private _Name As String
- Private _BirthDate As Date
- Private _Sex As Boolean
- Private _Salary As Decimal
- Private _BirthPlace As String
- '姓名
- Property Name() As String
- Get
- Return Me._Name
- End Get
- Set(ByVal Value As String)
- Me._Name = Value
- End Set
- End Property
- '出生日期
- Property BirthDate() As Date
- Get
- Return Me._BirthDate
- End Get
- Set(ByVal Value As Date)
- Me._BirthDate = Value
- End Set
- End Property
- '性别
- Property Sex() As Boolean
- Get
- Return Me._Sex
- End Get
- Set(ByVal Value As Boolean)
- Me._Sex = Value
- End Set
- End Property
- '月工资
- Property Salary() As Decimal
- Get
- Return Me._Salary
- End Get
- Set(ByVal Value As Decimal)
- Me._Salary = Value
- End Set
- End Property
- '出生地址
- Property BirthPlace() As String
- Get
- Return Me._BirthPlace
- End Get
- Set(ByVal Value As String)
- Me._BirthPlace = Value
- End Set
- End Property
- '年龄,只读属性,根据出生日期计算
- ReadOnly Property Age() As Integer
- Get
- Return Now().Year - BirthDate.Year + 1
- End Get
- End Property
- End Class