冷眼 - 技术专栏

态度决定高度,责任胜于能力;思想比知识更重要,成长比成功更重要!

   :: 首页 ::  :: 联系 ::  :: 管理 ::
  14 随笔 :: 13 文章 :: 0 评论 :: 0 Trackbacks
<%
Class Rectangle
   Private intWidth
   Private intHeight

   Public Property Let width(iWidth)
      intWidth = iWidth
      '参数验证略
   End Property

   Public Property Let height(iHeight)
      intHeight = iHeight
      '参数验证略
   End Property

   Private Sub Class_Initialize
      '类初始化代码
   End Sub

   Public Function perimeter()
      '返回矩形的周长
      getResult = 2*(intHeight + intWidth)
   End Function

   Private Sub Class_Terminate
      '类销毁时执行的代码
   End Sub

End Class


'调用类
Dim obj
Set objRectangle = new Rectangle
objRectangle.width = 10
objRectangle.height = 20
Response.Write(objRectangle.perimeter())
Set objRectangle = Nothing
%>
posted on 2008-05-26 16:53 冷眼 阅读(429) 评论(0)  编辑  收藏 所属分类: ASP