Using the Internet Transfer Control: Part 1
To load the control, open VB, click Project, Components. Scroll down and select Microsoft Internet Transfer Control.
The Internet Transfer Control exposes some useful properties. First of all, the AccessType property. This can have three different values. There are as follows:
icUseDefault is the one you will use most of the time, but icDirect and icNamedProxy allow you to really make your application very flexible. The Inet control exposes a Proxy property which allows you to specify the name/IP address of a computer to go through to get data.
When it comes to protocols, the Inet control has them all! Just take a look:
Most of the time you will be using icHTTP and icFTP, although you may stray across the others at some time. Most of the names are self explanatory, so I won't bother saying what each one does. The control also gives the following properties:
- 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
Page 2 of 4