我看到很多关于如何处理课程的“教程”,但我无法理解,而且所有这些都是在 c# 中而不是在 vb.net 中解释的不知道为什么
所以我的问题是:如何在此类中实现 IDisposable
Public Class Container
Private _sItemName As String
Private _sPrice As Single
Private _sPriceTot As Single
Private _iNumber As Integer
Sub New(ByVal _sItemName As String, ByVal _sPrice As Single, ByVal _sPriceTot As Single, ByVal _iNumber As Integer)
Me._sItemName = _sItemName
Me._sPrice = _sPrice
Me._iNumber = _iNumber
Me._sPriceTot = _sPriceTot
End Sub
Public Property sItemName() As String
Get
Return _sItemName
End Get
Private Set(value As String)
_sItemName = value
End Set
End Property
Public Property sPriceTot() As Single
Get
Return _sPriceTot
End Get
Private Set(value As Single)
_sPriceTot = value
End Set
End Property
Public Property sPrice() As Single
Get
Return _sPrice
End Get
Private Set(value As Single)
_sPrice = value
End Set
End Property
Public Property iNumber() As String
Get
Return _iNumber
End Get
Private Set(value As String)
_iNumber = value
End Set
End Property
End Class
在有人问我想要做的是与 C++ 中的 .delete 做同样的事情之前