有一个dataarrival事件,在里面写代码不就行了。

解决方案 »

  1.   

    DataArrival Event
          Occurs when new data arrives.Syntaxobject_DataArrival (bytesTotal As Long)The DataArrival event syntax has these parts:Part Description 
    object An object expression that evaluates to an object in the Applies To list. 
    bytesTotal Long. The total amount of data that can be retrieved. 
    ResThis event will not occur if you do not retrieve all the data in one GetData call. It is activated only when there is new data. Use the BytesReceived property to check how much data is available at any time.
    DataArrival
    This event occurs when new data arrives in a Winsock control.Syntax
    Private Sub winsock_DataArrival(bytesTotal)Parameters
    winsock 
    Object expression that evaluates to a Winsock control. 
    bytesTotal 
    Number of bytes in the input queue. 
    Res
    This event occurs only if you retrieve all the data in one GetData call, and only if there is new data to retrieve. Use the BytesReceived property to determine how much data is available.
      

  2.   

    首先你要保证有一个正确的连接,先告诉我是udp还是tcp?
      

  3.   

    首先要request,然后再arrivaldata就可以了。