Winsock Control Poperti[VB TIPS]

Diposting oleh Admin | Tuesday, July 01, 2008 | , | 0 komentar »

Winsock control owning 9 properti, 7 method, and 7 event which needing your attention on your made aplication network moment with winsock control. properti, method, and event will be commented step by step following function and the example so that you can using according to requiriment.

Properti
properti tend to more asking for first assess before winsock operating. sample for knowing remote ip target needed remote host, the representing computer local description, like LocalIp and LocalHost. there 9 properti to studied on this session.

Properti [BytesReceived]
this properti function for returning assess or amount size the received date. the set of as byte and data type as long.

syntax:
Object.BytesReceived
ex:
Dim X As Long
X=Winsock1.BytesReceived

with sample above your have got a value about amount and received size measure. Nature of this properti is Read-only

Properti [LocalHostName]
this properti function to returning local computer name, data type is string

syntax:
object.LocalHostName
ex:
Dim x as string
x=winsock1.LocalHostName

Properti [LocalIP]
Tthis peoperti Function for returned IP address local computer. data type as string
syntax:
object.localIP
ex:
dim x as string
x=winsock1.localIP
This properti is read-only

properti [ LocalPort ]
this properti function for returned port local computer, data type as long

Syntax:
object.LocalPort
ex:
winsock1.localPort=0
this properti is read/write

properti [ Protocol ]
this properti function for chosening protocol type in use.
there is 2 type protocol:
TCP(0-sckTCPProtocol), this default value
UDP(1=sckUDPProtocol)

syntax:
object.Protocol
ex:
winsock1.protocol=0
winsock1.protocol=sckTCPProtocol

this properti is read/write

Properti [RemoteIp]
properti function for returning computer remote port, data type as string

syntax:
object.RemoteIp
ex:
Dim x as string
x=winsock1.RemoteIp

Properti [RemotePort]
properti RemotePort Function for returning or determining which port whish gone to remote computer, data type as long.

syntax:
object.RemotePort=long
var_long=Object.RemotePort
ex:
Dim X as Long
X=winsock1.RemotePort 'reading
winsock1.remoteport=6667 'determining

Properti [State]
this properti function for returning integer value inteconnected with connection condition and also that happened error during winsock control operating. data type as integer

syntax:
object.state
x=winsock1.state 'reading

from returned value from this properti we can knowing any kind of happened on moment winsock control operating

0 komentar