且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么相当于c#windows窗体中vb6的winsock控件属性'UBound'

更新时间:2023-12-06 11:45:10

UBound 只是上限 sckClient WinSock 控件的数组


如解决方案1中所述,UBound表示一个上限阵列。在这种情况下,在winsock控件上,它是连接的上限。请参见 http://www.vbforums.com/showthread.php?301503-Winsock-Connection - (数组) [ ^ ]

hi my name is vishal.
I was wondering what is equivalent of winsock properties of UBound of vb6 in c# windows forms with sql server2008?
I know this is naive question but with this answer i can solve my other problems with winsock in c# windows forms.
Given below is code in vb6 of using UBound property of winsock into table named:reprocess in Ms access.

Private Sub Form_Load()
On Error GoTo errh
    Me.Icon = MDIForm1.Icon
    Dim vSQLStr As String
    Dim oRS As New ADODB.Recordset
    Dim i As Long
    Dim dBOOL As Boolean
    Dim dMstr As String
    Dim dPID As String
    vSQLStr = "select ManufacturerName,DCS_ip_address from reprocess"
    oRS.Open vSQLStr, adoDatabase, adOpenForwardOnly, adLockReadOnly
    lstIP.Clear
    dBOOL = False
    Do While Not oRS.EOF
         '// Do something with the data'
         If (oRS.Fields("DCS_ip_address").Value <> "") Then
            For i = 0 To MDIForm1.sckClient.UBound
               If (oRS.Fields("DCS_ip_address").Value = MDIForm1.sckClient(i).RemoteHostIP) Then
                   lstIP.AddItem oRS.Fields("ManufacturerName").Value & " - " & oRS.Fields("DCS_ip_address").Value
                   dBOOL = True
                   Exit For
               End If
            Next i
        End If
         oRS.MoveNext
    Loop
    oRS.Close
 Exit Sub
errh:
    MsgBox Err.Description, vbCritical
End Sub


where lstIP is name of my listbox in vb6 adodb with Ms access.
where sckClient is name of my winsock control in vb6 adodb with Ms access.

I just want to know if there is any property equivalent of UBound of winsock control of vb6 adodb with Ms access in winsock control of c# windows forms?

Can anyone help me please?Any help or guidance in solving of this problem would be greatly appreciated.

UBound is simply the upper bound: sckClient is an array of WinSock controls.


As mentioned in Solution 1, UBound means the upper bound of an array. In this case on the winsock control it is the upper bound of the connections. See http://www.vbforums.com/showthread.php?301503-Winsock-Connection-(array)[^]