嗯,我的问题很简单。
我想将属性添加到预定义的类中。
Imports Lidgren.Network
Module Socket
Public Clients As List(Of NetConnection) = New List(Of NetConnection)
需要添加"index"属性,使其为"客户端(发送方)。索引"
您使用
List(Of T)
,以便可以访问它的 IndexOf 方法 - 它返回集合中从零开始的位置。
Dim i As Integer = Clients.IndexOf(sender)