当前位置: 移动技术网 > IT编程>脚本编程>VBScript > VBS InternetExplorer.Application的属性和方法介绍

VBS InternetExplorer.Application的属性和方法介绍

2017年12月08日  | 移动技术网IT编程  | 我要评论

广州公交网查询,上海配货站,一人一首成名曲

示例代码

set ie = createobject("internetexplorer.application") 
ie.navigate "//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 "//www.jb51.net" '设置ie对象默认指向的页面

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

internetexplorer object

42 out of 82 rated this helpful 

controls an instance of windows internet explorer through automation.

members table

the following table lists the members exposed by the internetexplorer object.

events

event description
fires before navigation occurs in the given object (on either a window or frameset element).
fires before navigation occurs in the given object (on either a window element or a frameset element).
fires when the enabled state of a command changes.
fires when a document is completely loaded and initialized.
fires when a navigation operation begins.
fires when a navigation operation finishes, is halted, or fails.
fires 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.
fires after a navigation to a link is completed on either a  element or a  element.
fires after a navigation to a link is completed on a window element or a frameset element.
fires when an error occurs during navigation.
creates a new process to handle the navigation.
fires when a new window is to be created.
fires when a new window is to be created.
raised when a new window is to be created. extends  with additional information about the new window.
fires when the  property is changed.
fires when the  property is changed.
fires before the internet explorer application quits.
fires when the  property is changed.
fires when the  property is changed.
fires when the  property is changed.
fires when the  property of the object is changed.
fires when a print template is instantiated.
fires when a print template is destroyed.
fired when an event occurs that impacts privacy, or when a user navigates away from a url that has impacted privacy.
fires when the progress of a download operation is updated on the object.
fires when the  method of the object changes the value of a property.
fired when a cross-domain redirect request is blocked.
fires to indicate the progress and status of microsoft phishing filter analysis of the current webpage.
fires when there is a change in encryption level.
fires when the status bar text of the object has changed.
fired when a third-party url is blocked.
fires when the title of a document in the object becomes available or changes.
not implemented.
not implemented.
not implemented.
not implemented.
fires when the visibility state of a content window, such as the browser window or a tab, changes.

methods

method description
computes the full size of the browser window when given the specified width and height of the content area.
executes a command and returns the status of the command execution using the  interface.
gets the value associated with a user-defined property name.
navigates backward one item in the history list.
navigates forward one item in the history list.
navigates to the current home or start page.
navigates to the current search page.
navigates to a resource identified by a url or to a file identified by a full path.
navigates 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.
associates a user-defined name/value pair with the object.
queries the object for the status of commands using the iolecommandtarget interface.
closes the object.
reloads the file that is currently displayed in the object.
reloads the file that is currently displayed with the specified refresh level.
shows or hides a specified browser bar.
cancels a pending navigation or download, and stops dynamic page elements, such as background sounds and animations.

properties

property description
sets or gets a value that indicates whether the address bar of the object is visible or hidden.
gets the automation object for the application that is hosting the .
gets a value that indicates whether the object is engaged in a navigation or downloading operation.
gets an object reference to a container.
gets the automation object of the active document, if any.
retrieves the fully qualified path of the internet explorer executable.
sets or gets a value that indicates whether internet explorer is in full-screen mode or normal window mode.
sets or gets the height of the object.
gets the handle of the internet explorer main window.
sets or gets the coordinate of the left edge of the object.
retrieves the path or title of the resource that is currently displayed.
gets the url of the resource that is currently displayed.
sets or gets a value that indicates whether the internet explorer menu bar is visible.
retrieves the frame name or application name of the object.
sets or gets a value that indicates whether the object is operating in offline mode.
gets the parent of the object.
retrieves the system folder of the internet explorer executable.
gets the ready state of the object.
sets or gets a value that indicates whether the object is registered as a top-level browser window.
sets or gets a value that indicates whether the object is registered as a drop target for navigation.
sets or gets a value that indicates whether the object can be resized.
sets or gets a value that indicates whether the object can display dialog boxes.
sets or gets a value that indicates whether the status bar for the object is visible.
sets or gets the text in the status bar for the object.
sets or gets whether the object is in theater mode.
sets or gets whether toolbars for the object are visible.
sets or gets the coordinate of the top edge of the object.
gets a value that indicates whether the object is a top-level container.
gets the user type name of the contained document object.
sets or gets a value that indicates whether the object is visible or hidden.
sets 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 . the resulting internetexplorermedium object supports the same events, methods, and properties as the internetexplorer object.

examples

the following example uses  in microsoft visual basic to launch an instance of internet explorer.

dim ie as shdocvw.internetexplorer
set 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

clsid clsid_internetexplorer
minimum availability internet explorer 4.0
minimum operating systems windows 98, windows ce 4.0

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网