Introduction
Since the maturity and popularization of internet technology, people can easily and quickly on the Internet for file downloading, information publishing, online video, instant access to information, e-mail delivery and other operations. The internet can be said to be a major innovation in human electronic technology in the 21st century, but also a substitute for a new generation of media. As a result of this major change, people's way of life has also been greatly affected, electronic shopping, online information database, online stock market real-time transactions such as springing up. So how are these ways achieved on the Internet? In this paper, we introduce the method of designing browser and FTP programs by using the unique network control of Visual Basic 6.0, which is popular in programming language nowadays.
Previous Visual Basic 4.0 did not provide a complete solution for Visual Basic enthusiasts to design Internet programs, while using some of the network controls provided by Visual Basic 6.0, you can design related programs for the Internet. In this article, I will use the Internet Transfer control6.0 with the Web Browser control, explains how to use Visual Basic 6.0 easy to design Browser and FTP program method.
Introduction to relevant content
Visual Basic 6.0 is an object-based program design system that integrates many of the features of a Windows system into a control. Controls in VB and other object-oriented languages also provide functionality controls that are common to Windows interfaces like button controls, text controls, and so on. Each control has its own properties and events, which can assign values to the control's properties, trigger the control's events, and implement specific functionality.
1, the main control introduction
1.1 Internet Transfer Control Introduction
Internet Transfer Control 6.0 is one of the controls that Microsoft provides for users to design Internet applications. It provides HTTP and FTP two kinds of Internet protocols. When using the Internet Transfer control, you must first set its access mode according to the nature of the network, which is divided into two kinds, which are connected directly to the Internet and connected to the Internet by proxy (proxy). When the relevant parameters are set, Internet Transfer control provides OpenURL and execute two methods for performing network-related operations. In the following design, the author will explain its usage.
Introduction to 1.2 Web Browser control
Web Browser Control was first provided by IE 3.0, and is automatically loaded when IE 3.0 is installed, and Visual Basic 6.0 turns it into an internal controls. It provides a navigate method to connect to a Web server.
Because the Internet Transfer control does not provide access to graphics mode, the resulting file can only be returned in text mode, and if the returned file contains graphics, the resulting HTML file must be converted to a program. In this, so I chose the web Browser control to do a conversion.
2. Web Browser Program Design
2.1 Network Parameter settings
First determine whether the network system is connected directly to the Internet or via proxy (proxy) to the Internet. You can use the following steps to determine how the system connects to the Internet: double-click My computer → control Panel → Internet Options to open the Internet Properties dialog box. Select the connection Options page in the Internet Properties dialog box to know whether the system is connected to the Internet by proxy or direct connection.
If the system is connected to the Internet through a proxy, you must find the address and port of the proxy server to facilitate program settings. The specific actions are as follows:
Click the Local Area Network Settings button to display the local area network (LAN) Settings dialog box, shown in Figure 1, where you can view the address and port of the proxy server.
Figure 1 LAN Setup dialog box
2.2 Program Design
(1) Create the program interface. Click the new Project command under the File menu to display the New Project dialog box, shown in Figure Two, click the Standard.EXE icon, create a project, and set the project file name to Webbrowser.vbp.
Figure 2 New engineering interface for Visual Basic 6.0
After the project file is created, the system automatically creates a form with the default form file name Form1.frm. Add the controls you want on the form, and adjust their size and position appropriately.