这是第一种方式:策略创建
Public Class MyClass
Private _Property As String
Property Property() As String
Get
Return _Property
End Get
Set(ByVal Value As String)
_Property = Value
End Set
End Property
Public Function DoSomething() As String
Return _Property & Now()
End Function
End Class
我也能做到这样:
Public Class MyClass
Public Property As String
Public Function DoSomething() As String
Return Property & Now()
End Function
End Class
哪种方式最好?
对不起,我输入的很快。 – Maysam 2012-03-13 13:48:01
不用担心。回答你的问题是重要的。 – 2012-03-13 13:49:17