Imports System.Web.Mail
Partial Class _Default
Inherits System.Web.UI.Page
Public Class person
Public Sub New()
End Sub
Private _name As String
Private _age As Integer
Private _eyecolor As String
Public Property name() As String
Get
Return _name
End Get
Set(ByVal value As String)
_name = value
End Set
End Property
Public Property age() As String
Get
Return _age
End Get
Set(ByVal value As String)
If value < 1 Then
value = 1
End If
_age = value
End Set
End Property
Public Property eyecolor() As String
Get
Return _eyecolor
End Get
Set(ByVal value As String)
_eyecolor = value
End Set
End Property
End Class
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim myperson As New person
myperson.name = "彭赞群"
myperson.age = "0"
myperson.eyecolor = "黑色的"
Label1.Text = myperson.name
Label2.Text = myperson.age
Label3.Text = myperson.eyecolor
End Sub
End Class