Changes

Internet Transfer Control in VB6

1,971 bytes added, 20:02, 6 February 2008
The following lines were added (+) and removed (-):
:Properties::AccessType property::*icUseDefault::*icDirect::*icNamedProxy::protocols::*icUnknown::*icDefault::*icFTP::*icGopher::*icHTTP::*icHTTPSicHTTP and icFTP*URL - The complete URL of what you want to communicate with. e.g. http://www.vbsquare.com/*RemoteHost - The name/IP address of the remote host you are connecting with.*RemotePort - The port to connect on. For HTTP connections, you want port 80. For FTP, port 21.*Document - The name of an individual document*UserName - Username to login with*Password - Password that goes with the username== Inet Control States ==The Internet Transfer Control provides us with one event, StateChanged. And, when this event is raised, it provides only one parameters, State. We can use this parameter to detect what state the control is in, and then react accordingly.State constants:*icConnected (4) - Connected*icConnecting (3) - Connecting*icDisconnected (10) - Disconnected*icDisconnecting (9) - Disconnecting*icError (11) - An error has occurred*icHostResolved (2) - The remote address given has been accepted*icNone (0) - No current state*icReceivingResponse (7) - A response is current being received*icRequesting (5) - Data is currently being requested*icRequestSent (6) - A data request has been sent*icResolvingHost (1) - The remote address given is currently being checked*icResponseCompleted (12) - A response was successfully completed*icResponseReceived (8) - A response has been receivedicConnected provides you with a failsafe way of knowing that you are connected to a remote machine. As icDisconnected also provides you with a way of knowing when you are offline. Probably the most useful constant is icError. This tells us that an error has occurred.ErrorConstants:*icBadUrl*icCannotConnect*icConnectFailed*icConnectionAborted*icNoRemoteHost On Error Goto vbErrHand vbErrHand: Msgbox Err.DescriptionThere is no way to detect runtime errors. 
Bureaucrat, administrator
16,192
edits