VB.Net Properties - Public Get, Private Set

后端 未结 6 1821
借酒劲吻你
借酒劲吻你 2021-01-31 13:32

I figured I would ask... but is there a way to have the Get part of a property available as public, but keep the set as private?

Otherwise I am thinking I need two prope

6条回答
  •  天涯浪人
    2021-01-31 13:54

        Public Property Name() As String
            Get
                Return _name
            End Get
            Private Set(ByVal value As String)
                _name = value
            End Set
       End Property
    

提交回复
热议问题