返回顶部
首页 > 资讯 > 精选 >VBS中InternetExplorer.Application的属性和方法有哪些
  • 588
分享到

VBS中InternetExplorer.Application的属性和方法有哪些

2023-06-08 10:06:06 588人浏览 独家记忆
摘要

这篇文章给大家分享的是有关VBS中InternetExplorer.Application的属性和方法有哪些的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。示例代码Set ie = C

这篇文章给大家分享的是有关VBS中InternetExplorer.Application的属性和方法有哪些的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

示例代码

Set ie = CreateObject("InternetExplorer.Application") ie.Navigate "https://www.jb51.net" Wscript.Sleep 1000 ie.Toolbar = 0 ie.visible=False ie.Document.f1.Word.value = kw If ie.Document.f1.word.value="" Then Wscript.Quit

上面是在网上看到的,Navigate Toolbar visible 等都是怎么用的??
怎么网上找不到它们的用法?
下面是一些属性说明:

Set ie=WScript.CreateObject("internetexplorer.application")
ie.menubar=0 '不显示IE对象菜单栏
ie.AddressBar=0 '不显示IE对象地址栏
ie.ToolBar=0 '不显示IE对象工具
ie.StatusBar=0 '不显示IE对象状态栏
ie.FullScreen=1 '全屏化IE对象
ie.Width=800 '设置IE对象宽度
ie.Height=600 '设置IE对象高度
ie.Resizable=0 '设置IE对象大小是否可以被改动
ie.visible=1 '设置是否可见
ie.Navigate "Https://www.jb51.net" '设置IE对象默认指向的页面

目的留个备份,方便我以后去MSDN上找用法。

InternetExplorer Object

42 out of 82 rated this helpful Rate this topic

Controls an instance of windows Internet Explorer through automation.

Members Table

The following table lists the members exposed by the InternetExplorer object.

Events

EventDescription
BeforeNavigateFires before navigation occurs in the given object (on either a window or frameset element).
BeforeNavigate2Fires before navigation occurs in the given object (on either a window element or a frameset element).
CommandStateChangeFires when the enabled state of a command changes.
DocumentCompleteFires when a document is completely loaded and initialized.
DownloadBeginFires when a navigation operation begins.
DownloadCompleteFires when a navigation operation finishes, is halted, or fails.
FileDownloadFires to indicate that a file download is about to occur. If a file download dialog box can be displayed, this event fires prior to the appearance of the dialog box.
NavigateCompleteFires after a navigation to a link is completed on either a window element or a frameSet element.
NavigateComplete2Fires after a navigation to a link is completed on a window element or a frameSet element.
NavigateErrorFires when an error occurs during navigation.
NewProcessCreates a new process to handle the navigation.
NewWindowFires when a new window is to be created.
NewWindow2Fires when a new window is to be created.
NewWindow3Raised when a new window is to be created. Extends NewWindow2 with additional infORMation about the new window.
OnFullScreenFires when the FullScreen property is changed.
OnMenuBarFires when the MenuBar property is changed.
OnQuitFires before the Internet Explorer application quits.
OnStatusBarFires when the StatusBar property is changed.
OnTheaterModeFires when the TheaterMode property is changed.
OnToolBarFires when the ToolBar property is changed.
OnVisibleFires when the Visible property of the object is changed.
PrintTemplateInstantiationFires when a print template is instantiated.
PrintTemplateTeardownFires when a print template is destroyed.
PrivacyImpactedStateChangeFired when an event occurs that impacts privacy, or when a user navigates away from a URL that has impacted privacy.
ProgressChangeFires when the progress of a download operation is updated on the object.
PropertyChangeFires when the PutProperty method of the object changes the value of a property.
RedirectXDomainBlockedFired when a cross-domain redirect request is blocked.
SetPhishingFilterStatusFires to indicate the progress and status of Microsoft Phishing Filter analysis of the current WEBpage.
SetSecureLockIconFires when there is a change in encryption level.
StatusTextChangeFires when the status bar text of the object has changed.
ThirdPartyUrlBlockedFired when a third-party URL is blocked.
TitleChangeFires when the title of a document in the object becomes available or changes.
UpdatePageStatusNot implemented.
WindowActivateNot implemented.
WindowMoveNot implemented.
WindowResizeNot implemented.
WindowStateChangedFires when the visibility state of a content window, such as the browser window or a tab, changes.

Methods

MethodDescription
ClientToWindowComputes the full size of the browser window when given the specified width and height of the content area.
ExecWBExecutes a command and returns the status of the command execution using the IOleCommandTarget interface.
GetPropertyGets the value associated with a user-defined property name.
GoBackNavigates backward one item in the history list.
GoForwardNavigates forward one item in the history list.
GoHomeNavigates to the current home or start page.
GoSearchNavigates to the current search page.
NavigateNavigates to a resource identified by a URL or to a file identified by a full path.
Navigate2Navigates the browser to a location that might not be expressed as a URL, such as a pointer to an item identifier list (PIDL) for an entity in the Windows shell namespace.
PutPropertyAssociates a user-defined name/value pair with the object.
QueryStatusWBQueries the object for the status of commands using the IOleCommandTarget interface.
QuitCloses the object.
RefreshReloads the file that is currently displayed in the object.
Refresh3Reloads the file that is currently displayed with the specified refresh level.
ShowBrowserBarShows or hides a specified browser bar.
StopCancels a pending navigation or download, and stops dynamic page elements, such as background sounds and animations.

Properties

PropertyDescription
AddressBarSets or gets a value that indicates whether the address bar of the object is visible or hidden.
ApplicationGets the automation object for the application that is hosting the WebBrowser Control.
BusyGets a value that indicates whether the object is engaged in a navigation or downloading operation.
ContainerGets an object reference to a container.
DocumentGets the automation object of the active document, if any.
FullNameRetrieves the fully qualified path of the Internet Explorer executable.
FullScreenSets or gets a value that indicates whether Internet Explorer is in full-screen mode or normal window mode.
HeightSets or gets the height of the object.
HWNDGets the handle of the Internet Explorer main window.
LeftSets or gets the coordinate of the left edge of the object.
LocationNameRetrieves the path or title of the resource that is currently displayed.
LocationURLGets the URL of the resource that is currently displayed.
MenuBarSets or gets a value that indicates whether the Internet Explorer menu bar is visible.
NameRetrieves the frame name or application name of the object.
OfflineSets or gets a value that indicates whether the object is operating in offline mode.
ParentGets the parent of the object.
PathRetrieves the system folder of the Internet Explorer executable.
ReadyStateGets the ready state of the object.
ReGISterAsBrowserSets or gets a value that indicates whether the object is registered as a top-level browser window.
RegisterAsDropTargetSets or gets a value that indicates whether the object is registered as a drop target for navigation.
ResizableSets or gets a value that indicates whether the object can be resized.
SilentSets or gets a value that indicates whether the object can display dialog boxes.
StatusBarSets or gets a value that indicates whether the status bar for the object is visible.
StatusTextSets or gets the text in the status bar for the object.
TheaterModeSets or gets whether the object is in theater mode.
ToolBarSets or gets whether toolbars for the object are visible.
TopSets or gets the coordinate of the top edge of the object.
TopLevelContainerGets a value that indicates whether the object is a top-level container.
TypeGets the user type name of the contained document object.
VisibleSets or gets a value that indicates whether the object is visible or hidden.
WidthSets or gets the width of the object.

Remarks

Internet Explorer 8. On Windows Vista, to create an instance of Internet Explorer running at a medium integrity level, pass CLSID_InternetExplorerMedium (defined in exdisp.idl) to CoCreateInstance. The resulting InternetExplorerMedium object supports the same events, methods, and properties as the InternetExplorer object.

Examples

The following example uses CreateObject in Microsoft Visual Basic to launch an instance of Internet Explorer.

Dim IE As SHDocVw.InternetExplorerSet IE = CreateObject("InternetExplorer.Application")

The following C# example launches an instance of Internet Explorer and navigates to a Web page. The code also demonstrates how to create an event handler to listen for the BeforeNavigate2 event. The project requires a reference to the Microsoft Internet Controls (SHDocVw) type library.

using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1{  class EventHandlers  {    public void OnBeforeNavigate2(object sender, ref object URL,                    ref object Flags, ref object Target,                    ref object PostData, ref object Headers,                    ref bool Cancel)     {      Console.WriteLine("BeforeNavigate2 fired!");    }  }  class Program  {    static void Main(string[] args)    {      EventHandlers e = new EventHandlers();      SHDocVw.InternetExplorer IE = new SHDocVw.InternetExplorer();      object Empty = 0;      object URL = "http://www.live.com";      // override BeforeNavigate2 event      IE.BeforeNavigate2 += new         SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(             e.OnBeforeNavigate2);      IE.Visible = true;      IE.Navigate2(ref URL, ref Empty, ref Empty, ref Empty, ref Empty);      System.Threading.Thread.Sleep(5000);      IE.Quit();    }  }}

Object Information

CLSIDCLSID_InternetExplorer
Minimum availabilityInternet Explorer 4.0
Minimum operating systemsWindows 98, Windows CE 4.0

感谢各位的阅读!关于“VBS中InternetExplorer.Application的属性和方法有哪些”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

--结束END--

本文标题: VBS中InternetExplorer.Application的属性和方法有哪些

本文链接: https://lsjlt.com/news/253648.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
  • VBS中InternetExplorer.Application的属性和方法有哪些
    这篇文章给大家分享的是有关VBS中InternetExplorer.Application的属性和方法有哪些的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。示例代码Set ie = C...
    99+
    2023-06-08
  • ASP中recordset的属性和方法有哪些
    在ASP中,recordset对象具有以下属性和方法: 属性: BOF:返回一个布尔值,指示记录集是否在第一条记录之前。 EOF:...
    99+
    2023-10-25
    ASP recordset
  • VBS中VBscript属性和Pattern属性的用法
    这篇文章主要讲解了“VBS中VBscript属性和Pattern属性的用法”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“VBS中VBscript属性和Pattern属性的用法”吧!Patte...
    99+
    2023-06-08
  • response对象的方法和属性有哪些
    response对象的方法和属性有以下几种:方法:- response.text:返回响应的内容,以字符串形式表示- respons...
    99+
    2023-09-16
    response
  • Html5中video标签有哪些属性和方法
    这篇文章主要介绍“Html5中video标签有哪些属性和方法”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Html5中video标签有哪些属性和方法”文章能帮助大家...
    99+
    2024-04-02
  • Python内置方法和属性有哪些
    本篇内容主要讲解“Python内置方法和属性有哪些”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Python内置方法和属性有哪些”吧!1.1 _del_方法(知道)在Python中当使用 类名(...
    99+
    2023-06-22
  • JavaScript中有哪些常用的属性方法
    JavaScript中有哪些常用的属性方法?很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。JavaScript常用属性方法有:document.write(&qu...
    99+
    2023-06-14
  • C#中form窗体常用属性和方法有哪些
    这篇文章主要为大家展示了“C#中form窗体常用属性和方法有哪些”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“C#中form窗体常用属性和方法有哪些”这篇文章吧。在追求编写高级代码的时候大家不要...
    99+
    2023-06-17
  • jqXHR对象公开的属性和方法有哪些
    本篇内容主要讲解“jqXHR对象公开的属性和方法有哪些”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“jqXHR对象公开的属性和方法有哪些”吧!   从 jQu...
    99+
    2024-04-02
  • C#中String类的属性及方法有哪些
    今天小编给大家分享一下C#中String类的属性及方法有哪些的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。String 类的...
    99+
    2023-06-17
  • VBS中TotalSize属性的用法
    这篇文章主要讲解了“VBS中TotalSize属性的用法”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“VBS中TotalSize属性的用法”吧!TotalSize 属性返回驱动器或网络共享的...
    99+
    2023-06-09
  • VBS中Description属性的用法
    这篇文章主要介绍“VBS中Description属性的用法”,在日常操作中,相信很多人在VBS中Description属性的用法问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”VBS中Description属性...
    99+
    2023-06-08
  • VBS中FirstIndex属性的用法
    这篇文章主要讲解了“VBS中FirstIndex属性的用法”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“VBS中FirstIndex属性的用法”吧!FirstIndex 属性返回在搜索字符串...
    99+
    2023-06-08
  • VBS中Global属性的用法
    本篇内容主要讲解“VBS中Global属性的用法”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“VBS中Global属性的用法”吧!Global 属性设置或返回一个 Boolean 值,该值指明在...
    99+
    2023-06-08
  • VBS中HelpContext属性的用法
    这篇文章主要讲解了“VBS中HelpContext属性的用法”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“VBS中HelpContext属性的用法”吧!HelpContext 属性设置或返回...
    99+
    2023-06-08
  • VBS中HelpFile属性的用法
    这篇文章主要讲解了“VBS中HelpFile属性的用法”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“VBS中HelpFile属性的用法”吧!HelpFile 属性设置或返回帮助文件的完整有效...
    99+
    2023-06-08
  • VBS中IgnoreCase属性的用法
    这篇文章主要介绍“VBS中IgnoreCase属性的用法”,在日常操作中,相信很多人在VBS中IgnoreCase属性的用法问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”VBS中IgnoreCase属性的用法...
    99+
    2023-06-08
  • VBS中Number属性的用法
    本篇内容介绍了“VBS中Number属性的用法”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!Number 属性返回或设置数值指定错误。Num...
    99+
    2023-06-08
  • VBS中Source属性的用法
    本篇内容介绍了“VBS中Source属性的用法”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!Source 属性返回或设置最初生成错误的对象或...
    99+
    2023-06-08
  • VBS中Value属性的用法
    本篇内容主要讲解“VBS中Value属性的用法”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“VBS中Value属性的用法”吧!Value 属性返回在一个搜索字符串中找到的匹配的值或文本。obje...
    99+
    2023-06-08
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作