基本上我有一個靜態共享成員的類。我想要一個運行一次的代碼來啓動該靜態共享成員。如何在vb.net中爲一個類運行一次代碼?
Class algorithm
Public name As String
Public lowPriceatNiceHash As Double
Public highPriceatNiceHash As Double
Public fixedPriceatNicehash As Double
Shared dictOfAlgorithm As Generic.Dictionary(Of String, algorithm)
End Class
現在dictOfAlgorithm字典應該在類的使用開始時設置爲新的空字典。一次也是唯一一次。
https://msdn.microsoft.com/en-us/library/z2cty7t8.aspx? –