![]() |
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
![]() |
To access the contents, click the chapter and section titles.
Visual Basic 6 Programming Blue Book: The Most Complete, Hands-On Resource for Writing Programs with Microsoft Visual Basic 6!
Internet Transfer Control Properties I have mentioned some of the Internet Transfer control properties. You can get a lot of use out of the control without worrying about most of its properties. For special situations, however, you may need to change some of them from their default values. I have not listed the standard control properties, such as Name and Index, but only those specific to this control. AccessType determines how the control accesses the Internet. The possible settings are:
Document specifies the name of the file that will be used with the Execute method if a document is not specified in the methods arguments. If this property is left blank, the servers default document is returned, or for write operations, an error occurs. Password specifies the password used when the control is logging onto a remote server. Protocol specifies the Internet protocol that will be used with the Execute method. The possible settings are shown in Table 18.4. The setting of this property interacts with the protocol, if any, included in the URL used with the OpenURL and Execute methods, and also with the URL property. If, for example, you call Execute and specify a URL, such as http://www.microsoft.com, then this property updates to reflect the HTTP protocol.
Proxy specifies the name of the proxy server used to communicate with the Internet. This property is used only if the AccessType property is set to icNamedProxy. RequestTimeout specifies the amount of time (in seconds) to wait for a response to a request before a time-out expires. If no response occurs within the specified time, and if the request was made with the OpenURL method (synchronous), an error is generated. If the request was made with the Execute method, the StateChanged event will occur with an error code. Set this property to zero to disable time-outs (the control will wait as long as needed). ResponseCode returns the error code from when the StateChanged event occurs with the icError argument. ResponseInfo provides a text description of the most recent error that occurred. StillExecuting returns True if the control is busy; otherwise, False. URL specifies the URL, including protocol, that is used by the Execute or OpenURL methods. If a URL is specified as a method argument, this property is updated to reflect that URL. Username specifies the user name that will be sent as a logon to remote computers. If this property is blank, then anonymous is sent. The WebBrowser ControlThe WebBrowser control lets you drop a fully functional Web browser onto a Visual Basic form. It has all the capabilities required to view, navigate, and process HTML pages. In fact, it is the same ActiveX component used in Microsofts Internet Explorer browser. Perhaps referring to this control as a partially functional Web browser would be more accurate, because it does not have its own menus, toolbar, or other elements that you are used to seeing in a standalone browser application. These elementsor whatever user interface components your application needsmust be provided as part of the Visual Basic program. Code in your program manipulates the WebBrowser control by means of its properties and methods. This enables the programmer to provide just the Web functionality that is desired. For example, you could write a browser that permits the user to access only pages on your companys own Web pages, preventing them from wasting time at other sites. The WebBrowser control is fairly easy to use. Basic operation can be achieved with very few program statements. For example, to view a particular Web page, all that is required is to place a WebBrowser control on a form and then place the following line of code in the forms Load event procedure (assuming the controls name is WB1): WB1.Navigate <www.wherever.com> Figure 18.3 shows The Coriolis Groups Web page displayed in a WebBrowser control. Once a page is displayed, the user can access all of the navigation and other features provided as part of the page. Other capabilitiesfor example, a Back buttonmust be implemented by the programmer. For details on the WebBrowser controls methods and properties, refer to the Visual Basic online Help system. Space limitations prevent me from giving it a full treatment. WebBrowser is a powerful component and should be all you ever need if you want to incorporate Web-browsing capabilities in your Visual Basic applications.
|
![]() |
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |