<%
Class Rectangle
???Private intWidth
???Private intHeight
???Public Property Let width(iWidth)
??????intWidth =?iWidth
??????'參數(shù)驗證略
???End Property
???Public Property Let height(iHeight)
??????intHeight =?iHeight
??????'參數(shù)驗證略
???End Property
???Private Sub Class_Initialize
??????'類初始化代碼
???End Sub
???Public Function perimeter()
??????'返回矩形的周長
??????getResult = 2*(intHeight + intWidth)
???End Function
???Private Sub Class_Terminate
??????'類銷毀時執(zhí)行的代碼
???End Sub
End Class
'調(diào)用類
Dim obj
Set objRectangle = new Rectangle
objRectangle.width = 10
objRectangle.height = 20
Response.Write(objRectangle.perimeter())
Set?objRectangle = Nothing
%>
Class Rectangle
???Private intWidth
???Private intHeight
???Public Property Let width(iWidth)
??????intWidth =?iWidth
??????'參數(shù)驗證略
???End Property
???Public Property Let height(iHeight)
??????intHeight =?iHeight
??????'參數(shù)驗證略
???End Property
???Private Sub Class_Initialize
??????'類初始化代碼
???End Sub
???Public Function perimeter()
??????'返回矩形的周長
??????getResult = 2*(intHeight + intWidth)
???End Function
???Private Sub Class_Terminate
??????'類銷毀時執(zhí)行的代碼
???End Sub
End Class
'調(diào)用類
Dim obj
Set objRectangle = new Rectangle
objRectangle.width = 10
objRectangle.height = 20
Response.Write(objRectangle.perimeter())
Set?objRectangle = Nothing
%>