什么相当于c#windows窗体中vb6的winsock控件属性'UBound' [英] what is equivalent of winsock control property 'UBound' of vb6 in c# windows forms

查看:130
本文介绍了什么相当于c#windows窗体中vb6的winsock控件属性'UBound'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的名字是vishal。

我想知道在使用sql server2008的c#windows窗体中,什么是相当于vb6的UBound的winsock属性?

我知道这是天真的问题,但有了这个答案,我可以解决我在c#windows窗体中使用winsock的其他问题。

下面给出了使用winsock的UBound属性的vb6中的代码,名为:Ms access in the access。 />

 私有  Sub  Form_Load()
On 错误 GoTo errh
Me .Icon = MDIForm1.Icon
Dim vSQLStr 作为 字符串
Dim oRS 作为 ADODB.Recordset
Dim i As Long
Dim dBOOL As Boolean
Dim dMstr As String
Dim dPID 作为 字符串
vSQLStr = 选择ManufacturerName,DCS_ip_address from reprocess
oRS.Open vSQLStr,adoDatabase,adOpenForwardOnly,adLockReadOnly
lstIP.Clear
dBOOL = False
执行 while oRS.EOF
' //对数据执行某些操作
如果(oRS.Fields( < span class =code-string> DCS_ip_address)。值<> 然后
对于 i = 0 MDIForm1.sckClient .UBound
如果(oRS.Fields( DCS_ip_address)。值= MDIForm1.sckClient(i).RemoteHostIP)然后
lstIP.AddItem oRS.Fields( ManufacturerName)。值& - & oRS.Fields( DCS_ip_address)。值
dBOOL = True
退出 对于
结束 如果
下一步 i
结束 如果
oRS.MoveNext
循环
oRS.Close
退出 Sub
errh:
MsgBox Err.Description,vbCritical
结束 Sub



其中 lstIP 是带有Ms访问权限的vb6 adodb中我的列表框的名称。

其中 sckClient 是使用Ms的vb6 adodb中我的winsock控件的名称访问。



我只想知道在winsock控件中是否有任何属性相当于 UBound 的winsock控制vb6 adodb和Ms访问权限c#窗体的形式?



有谁可以帮助我?对于解决这个问题的任何帮助或指导都将不胜感激。

解决方案

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)[^]


这篇关于什么相当于c#windows窗体中vb6的winsock控件属性'UBound'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆