




已阅读5页,还剩4页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
用 VB构建 INTERNET的应用【摘要】 发展 Internet 技术为编程人员提供了更广泛的施展身手的空间。早先“Internet 应用 程序 这个词只是指一些用 FTP 协议下载文件或浏览HTML 页面的工具,如今使用 Visual Basi c,不仅可为 Internet 开发应用程序,还可把 Internet 技术作为一部分融入大型的 解决方案中。【关键词】Internet;Visual Basic;ActiveX 组件;技术;程序发展 Internet 技术为编程人员提供了更广泛的施展身手的空间。早先“Internet 应用程序 这个词只是指一些用 FTP 协议下载文件或浏览 HTML页面的工具,如今使用 Visual Basic,不仅可为 Internet 开发应用程序,还可把 Internet 技术作为一部分融入大型的 解决方案中。这里所要讨论的 问题 是利用 Visual Basic 创建面向 Internet 应用起重要作用的 ActiveX 组件。例如,所创建的 ActiveX 控件可用于 HTML 页面;开发ActiveX 文档可以在 Internet 浏览器中使用并与其他组件一起和 HTML 页面集成;另外 ActiveX 代码组件 ( 以前被称为 OLE 服务器 ), 可以被部署在客户端或服务器端的 计算 机上,用于后台的处理。一、Internet 开发环境Internet 是使用 TCP/IP 协议、全球性非集中管理的计算机 网络 。如果用于局部, 所谓“Internet 技术完全可以和本地局域网中所使用的技术一样。一方面, Internet 技术为开发人员提供了一个施展身手的空间。如果和Web 连接时使用 了 ActiveX 组件,尽管具体实现的 方法 有所不同,如采用了 HTML 和 VB Script 代码以实现安全性等,但仍然在调用方法、设置属性、处理事件等等。这 样,VB 开发人员所有的知识和技能都被用于 Internet 环境。另一方面,应用 Internet 技术可延伸开发工作。如将 ActiveX 组件和 Internet技术综合 有以下益处:更简单维护作为 Web 一部分的组件可以根据需要下载,无须用户运行一个 setup 程序进 行升级;将功能延伸至 Internet通过通用协议,用户将看不见在 Internet 和 Intranet 之间的切换。二、Internet 客户/服务器可以借用客户机/服务器的关系来考查 Internet 的开发环境,客户端和服务器端都可以有“ 静 态的和“活动的两种状态。活动的客户机或服务器可据其内部状态的改变而动态地运 行一个脚本或是改变其行为;静态的客户机或服务器仅仅只是对外界激励作出反应。Internet 开发包括四种情形:静态的客户机和静态的服务器;静态的客户机和活动的服务器;活动的客户机和静态的服务器;活动的客户机和活动的服务器。三、在 Web 上使用 ActiveX 组件ActiveX 组件为 Internet 技术带来新功能。通过 Internet 组件的下载、超连接、菜单协商等各种功能,将 ActiveX 组件和 Internet 集成起来, 内容 和应用程序之间的界线越来越模糊;另外由于在站点上(在客户机和服务器之间)分布功能函数,则可创建更具扩展性 和灵活性的站点。在 Internet 应用程序中使用 ActiveX 文档,可以开发和 Internet/Intranet站点的其他元素紧密集成的 Visual Basic 的应用程序。利用这些组件开发出来的应用程序,用户可以透明地在 HTML 页面和 Active X 文档之间迁移。可以把 ActiveX 文档作为 Visual Basic 为 Internet 提供的应用,几乎现在用标准应用程 序完成的工作都可以用 ActiveX 文档实现。作为 HTML 页面中的一个元素,如果在用户的客户机上没有安装 ActiveX 文档, 用时可以自动 地从网上下载;如果客户机上的版本较旧, 也可自动升级。?ActiveX 文档的许多特性提供了安装和导航性能,并可以保证持续一致性:Internet 组件的下载可创建一个到 ActiveX 文档的连接,使浏览器可以自动找到并下载所有需要的组件。超连接对象在一个超连接感知的包容器中,可使用 Visual Basic 的超连接对象的属性和方法,跳转到一个给定的 URL 或是通过 历史 记录清单进行导航。菜单和协商由于可以从 Word 或 Excel 中获得文档,Visual Basic 的ActiveX 文档提供了将 其菜单嵌入浏览器中的菜单的功能。例如当文档被装载入 Internet Explorer 中后,浏览器 的菜单将与该 ActiveX 文档创建的菜单混合。PropertyBag当在 Internet Explorer 中部署 ActiveX 文档时, 可以通过 Propert yBag 对象保持数据的一致性。在 Internet Explorer 中部署一个 ActiveX 文档,要通过一个 HTML 页面中的超连接连接到这个 ActiveX 文档上。1. 用 HTML 创建引用这个 ActiveX 文档的连接。由于 ActiveX 文档将在Internet Explorer 中取代 HTML 页面,所以要将组件的 OBJECT 标签 放在另一个 HTML 页面中。当跳转到该页面后,一旦 ActiveX 文档被装载,它就会立刻消失。2. 用 HTML 为浏览器提供下载、注册以及导航到这个 ActiveX 文档的途径。在 OBJECT 标签中应 该说明 ActiveX 文档的类 ID 和 CODEBASE 属性。3. 在同一页面上, 使用 VBScript 指示 Internet Explorer 立刻通过相应的vbd 文件导航到 该 ActiveX 文档上。四、在 Internet 应用程序中使用 ActiveX 控件ActiveX 控件为 HTML 页面带来了活力:通过 HTML 和 VBScript, 可在一个 HTML 页面上 使用 ActiveX 控件, 设置其属性,调用其方法并处理其事件;一个包含控件的 的 HTML 页面仿佛一个 Visual Basic 的设计窗口,ActiveX控件可以提供更多交互式且生动的 用户界面特性,使 HTML 页面变得更加有活力。一般需要通过 HTML 和 VBScript 的综合手段引用并控制 ActiveX 控件的行为。使用 HTML 为浏览 器提供下载,注册并引用 ActiveX 控件引用的途径。在 HTML 代码的 OBJECT 标签中需要包括:1.控件的类别 ID, 以使程序能在 Windows 的注册表中找到它们;2.、 ID 的属性,以便在 VBScript 中引用该控件( 类似于 Visual Basic 中的Name 属性) ;3.CODEBASE 属性,告诉浏览器如果组件不在客户机上该去哪儿找;4.PARAM NAME 标签,设置控件的属性参数。然后用 VBScript 编写处理单击事件的代码,使每一个控件被单击后,程序可以作相应的动作。Visual Basic 专业版中还包括了三个已预先设计好的用于包裹 Internet 相关技术的控件, 能够扩展已有的 应用 程序,它们是:Internet Transfer Control包裹了三种通用的 Internet 协议:HTTP、FTP 和 Gopher;WebBrowser Control包含了许多通过 Internet Explorer 可以获得的功能;WinSock Control可以连接到一台远程的机器, 然后通过 UDP 或TCP 交换数据。通过使用这些控件, 可以添加从 FTP 站点自动下载文件的功能,还可以为Visual Basic IDE 提供 Web 浏览器的 Add-in。在 Internet 应用程序中使用 ActiveX 代码组件,无论是在客户端或是在服务器端, 都可以使用 ActiveX 代码组件(dll 或 exe 文件),从而为 HTML 页面添加功能。在客户端部署代码组件, 由于用户命令无须通过 网络 传输回服务器,于是可以大大提高运行速度。服务器端的组件同样也可以有显示用户界面可视化元素的功能。通过下载一个 DLL, 可以在 HTML 页面上添加用户界面的元素,如一个登录对话框; 还可以提供幕后的客户端处 理能力,如一个伴随 VBScript的函数库。另一种将 DLL 和 Internet 技术结合的方法是将它部署在服务器端。如果有Internet Information Server (IIS)(包含在 Windows NT Server 4.0 中), 可以通过 Visual Basic 关盘中 的 Tools 目录下的 Oleisapi2 dll 调用 Visual Basic中内置的 DLL 函数。Oleisapi2 dll 中包含了 ISAPI 中的所有函数。可以把 DLL 部署在 HTTP 服务器上, 并通过 HT ML 页面上发送的信息调用其方法。Oleisapi2 dll 作为客户,请求到 DLL 之间的中介。由于代码基于 HTML,这些请求仅仅是简单的 URL。通过服务器端的 DLL,可以由客户提供的参数定制返回给客户的 HTML 页面,还可以管理数据库的连接,对接受到的请求和返回的结果进行整理和编组。参考文献 1陈明.Visaul Basic 程序设计M.中央广播电视大学出版社,2000.2金茂忠.NET 编程基础 M.中央广播电视出版社, 2004.3丁爱萍.Visaul Basic 程序设计(第 2 版)M. 电子 工业 出版社,2004.4文渊阁工作室.reamweaver XM 2004 扩展程序与密技M. 中国 铁道出版社,2005.INTERNET used to build VB applications【Abstract】 Development of Internet technology as the programmer to provide a broader space for their skill. Earlier Internet Applications is the word refer to those with FTP protocol to download files or browse the HTML page tool, now use Visual Basi c, not only the development of applications for the Internet, but also the integration of Internet technology as part of large-scale solutions in.【Key Words】 Internet; Visual Basic; ActiveX components; technology; procedures.The development of Internet technology as the programmer to provide a broader space for their skill. Earlier Internet Applications is the word refer to those with FTP protocol to download files or browse the HTML page tool, now use Visual Basic, not only the development of applications for the Internet, but also the integration of Internet technology as part of large-scale solution . Here the questions to be discussed is the use of Visual Basic to create applications for the Internet play an important role in the ActiveX component. For example, the creation of ActiveX controls can be used for HTML pages; the development of ActiveX documents can be used in Internet browsers and other components integrated together and HTML pages; other ActiveX code components (formerly known as OLE server), can be deployed the client or server computer, for background processing.A, Internet Development Environment Internet is the use of TCP / IP protocol, a global non-centralized management of computer networks. If for the local, the so-called Internet Technology and local LAN can be used in the same technology. On the one hand, Internet technology developers to provide a space for their skill. If the Web connection and the use of ActiveX components, although the specific methods to achieve different, such as the use of HTML and VB Script code in order to achieve security, but still call the method, set properties, handle events and so on. This, VB developers of all knowledge and skills have been used in Internet environment. On the other hand, an extension of the application of Internet technology development. Such as ActiveX components and Internet technologies have the following benefits: easier to maintain - as a Web part of the necessary components can be downloaded without the user run a setup program to upgrade; will feature extended to the Internet - through the General Agreement, the user will not see in between the Internet and Intranet switch.Second, Internet client / server Can use client / server to test the relationship between the Internet development environment, client and server can have static and the two states. The activities of the client or the server may change its internal state and dynamically, or run a script to change their behavior; static client or the server is only incentive to respond to the outside world. Internet development, including four cases: a static and passive client server; static client server and activities; the activities of the client and the server static; activities and activities of the client server.Third, the use of ActiveX components Web .ActiveX components for Internet technology brings new features. Downloaded through the Internet components, super-connected, the menu features a variety of consultations, the ActiveX components and Internet integration, and content and applications has become increasingly blurred line between; another site due to (in the client and server between) the distribution function, you can create a more scalable and flexible site. Internet applications in the use of ActiveX documents, can be developed and the Internet / Intranet site of the other elements of the tight integration of Visual Basic applications. Developed the use of these components of the application, users can transparently in the HTML pages and Active X documents migration between. ActiveX documents can be as a Visual Basic application for the Internet to provide almost standard now to complete the work of the application can achieve using ActiveX documents. As an HTML page elements, if the users client does not install ActiveX documents, and can be downloaded from the Internet automatically; if the client on the older version can also be automatically upgraded. ? ActiveX document provides many features to install and navigation performance, and to ensure continued consistency: Internet component download - can create a link to the ActiveX document, so that the browser can automatically find and download all the required components. Ultra-connected objects - in a super-connected packet-aware container, you can use Visual Basic to connect the super-object properties and methods, Jump to a given URL or through the navigation history list. Menu and consultation - as a result can get Word or Excel document, Visual Basic provides the ActiveX Document embedding its menu in your browser menu functions. For example, when being loaded into the document in Internet Explorer, the browsers menu will be created with the ActiveX document mixed menu. PropertyBag - When in Internet Explorer in the deployment of ActiveX document, Propert yBag can maintain the consistency of data objects. In Internet Explorer in the deployment of an ActiveX document to HTML page through a super-connection to connect to the ActiveX document.1.To use HTML to create quote connect the ActiveX document. Document will be as a result of ActiveX in Internet Explorer to replace the HTML page, so to OBJECT tags on components of another HTML page. When the Jump to the page, once the ActiveX document is loaded, it will immediately disappear. 2.Using HTML for the browser available for download, registration and navigation to the way the ActiveX document. OBJECT tag in the ActiveX document should indicate the type of ID and the CODEBASE attribute. 3. In the same page, Internet Explorer using VBScript instructions immediately through the appropriate navigation vbd file to the ActiveX document.Fourth, in the Internet applications use ActiveX controls .ActiveX control for a dynamic HTML page: the adoption of HTML and VBScript, in an HTML page can use ActiveX controls, set its properties, call its methods and its events; a control that contains the HTML page as if the design of a Visual Basic the window, ActiveX controls can provide more vivid and interactive user interface features to make HTML pages more dynamic. General HTML and VBScript by means of a comprehensive reference and control the behavior of ActiveX controls. The use of HTML for the browser available for download, registration and reference channels quoted ActiveX controls. HTML code in the OBJECT tag to include:1.Control the type of ID, in order to process the registry in Windows to find them; 2.ID attributes in order to invoke the control in VBScript (Visual Basic is similar to the Name attribute); 3.CODEBASE attribute to tell if the component is not the browser client to find where to go; 4.PARAM NAME label, set the properties of the control parameters. Prepared to deal with and then use VBScript code click events so that each control by click, the program can be used for the corresponding action.isual Basic Professional Edition also includes three pre-designed packages for control of Internet related technologies, to expand existing applications, they are: Internet Transfer Control - three parcels of common Internet protocol: HTTP, FTP and Gopher; WebBrowser Control - includes many available through the Internet Explorer features; WinSock Control - can connect to a remote machine, and then through the UDP or TCP to exchange data. Through the use of these controls can be added automatically from the FTP site to download files, Visual Basic IDE can also provide Web browser Add-in. Internet applications in the use of ActiveX code components, whether the client or the server side, you can use ActiveX code components (dll or exe files), so as to add features HTML page.The deployment of code on the client components, there is no need as a result of user commands are transmitted over the network back to the server, so can greatly improve the speed. Server-side component can also display the user interface functions of visual elements. By downl
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年春季中国邮政储蓄银行广西区分行校园招聘考前自测高频考点模拟试题及答案详解(网校专用)
- 2025河北张家口启臻学校高中储备教师招聘考前自测高频考点模拟试题及答案详解(夺冠系列)
- 2025河南新乡新华医院新乡市中西医结合医院招聘考前自测高频考点模拟试题及参考答案详解
- 2025安徽艺术学院高层次人才招聘30人模拟试卷有答案详解
- 硅藻土综合利用项目环境影响报告书
- 入河排污口整治工程施工方案
- 教育教学质量提升研讨会校长讲话:从倒数到前三这些班级靠3个反常识做法实现逆袭
- 社交敬酒礼仪知识案例分析试题及答案
- 2025年人造革厂岗前安全生产试题及答案
- 2025年高中二年级数学导数周试题及答案
- 物业资产安全培训宣传稿课件
- 财务预算编制与执行控制案例汇编
- 智慧校园XXX学院总体解决方案
- 2025-2026学年人教版(2024)七年级上学期第一次月考英语试题(含答案无听力原文及音频)
- 2025年大学实验室安全知识试题及答案
- 农民专业合作社资金使用管理协议
- 国庆期间安全驾驶培训课件
- 商场品牌引进
- ICEEMDAN与优化LSSVM结合的大坝变形预测模型研究
- 钢结构施工工艺指导手册
- 人工智能技术及应用 第2版 习题及答案
评论
0/150
提交评论