There are two ways to submit information to the far end and return data.
OpenURL and EXECUTE methods, respectively
1. If you are using the OpenURL method, its return value is the data returned by the target host, as follows: Dim Restrings As stringRestring = inet1.openurl ("http://www.54nb.com") This restring is 54NB page code
2. If you are using the Execute method, you can get the data through the StateChanged event. This event handler has an important parameter state, we can perform different operations depending on its value (see the specific value to see Schedule) Get data instance,
Inet1.execute "http://www.54nb.com" While inet1.stillexecuting "The execution process is executed during this method (the execute method is executed asynchronously, so other operations must be temporarily suspended to wait for the data) DOEvents Wend private sub inet1_statechanged (byval state as integer) DIM STEMS STRING IF State = 12 TEN 'Request completion, start extracting data, using the getchunk method Extract 1024 byte data each time, loop until the data extraction STEMP = INET1.Getchunk (1024 While Stemp <> "" restrings = restring STEMP STEMP = inet1.getchunk (1024)
Wend inet1.cancel end if End Sub
Schedule: State's value and its corresponding status 0 icnone stateless reportable. 1 IchostResolvingHost This control is queried to the IP address of the host specified. 2 IchostResolved This control has successfully found the IP address of the host specified host. 3 icconnecting This control is connected to the host. 4 icconnected The control has been successfully connected to the host. 5 iCRequesting This control is sending a request to the host. 6 IcRequestSent This control has been successfully requested. 7 ICReceivingResponse This control is receiving the response of the host. 8 icrsponsereceived This control has successfully received the response of the host. 9 Icdisconnecting This control is being lifted with the host's connection. 10 Icdisconnected This control has successfully released connection with the host. 11 Icerror has an error when communicating with the host. 12 IcResponseCompleted This request has been completed and all data has been received.