2020年2月29日 星期六

VBscript

https://zh.wikipedia.org/zh-tw/VBScript


VBScript 維基百科,自由的百科全書
VBScript VBScript file format icon.png
實作者 微軟 面市時間 1996年,​24年前
穩定版本 5.8
作業系統 Windows
副檔名 .vbs, .vbe, .wsf, .wsc (.hta, .htm, .html, .asp)
網站 docs.microsoft.com/en-us/previous-versions/t0aew7h6(v=vs.85) 編輯維基數據鏈接
主要實作產品 Windows Script Host, Active Server Pages
啟發語言 Visual Basic
影響語言 Windows PowerShell

=========================================================================


VBScript是Visual Basic Script的簡稱,有時也被縮寫為VBS。VBScript是微軟開發的一種手稿語言,可以看作是VB語言的簡化版,與Visual Basic for Applications的關係也非常密切。它具有原語言容易學習的特性。目前這種語言廣泛套用於網頁和ASP程式製作,同時還可以直接作為一個可執行程式。用於除錯簡單的VB語句非常方便。

少數可直接配置在作業系統中,作為【Local】【跨系統(部份支持)】【Clinent】的少數語言之一


Windows作業系統

【用途】一如 BATscript 功能則更為強大,配置於 Wscript 控制單元足以取代作業系統使用者。
https://www.itread01.com/article/1527756437.html

網頁瀏覽器(客戶端的VBS)

【用途】 木馬屠城記 於網頁瀏覽器的控制項目,進而入侵作業系統的控制權。
https://docs.microsoft.com/zh-tw/windows-server/administration/windows-commands/wscript

Windows Script Host 提供一個環境,讓使用者可以使用各種不同的語言來執行腳本,以執行工作。
語法 wscript [] [/b] [/d] [/e:] [{/h:cscript|/h:wscript}] [/i] [/job:] [{/logo|/nologo}] [/s] [/t:] [/x] [/?] []

參數 描述
scriptname 指定腳本檔案的路徑和檔案名。
/b 指定不會顯示警示、腳本錯誤或輸入提示的批次模式。 這與 /i相反。
/d 啟動偵錯工具。
/e 指定用來執行腳本的引擎。 這可讓您執行使用自訂副檔名的腳本。 如果沒有/e 參數,您只能執行使用已註冊之副檔名的腳本。 例如,如果您嘗試執行此命令:
cscript test.admin
您會收到此錯誤訊息:輸入錯誤:副檔名不是 ". admin" 的腳本引擎。
使用非標準的副檔名的其中一個優點是,它可以防止不小心按兩下腳本,並執行您真的不想要執行的東西。
這不會建立 admin 副檔名和 VBScript 之間的永久關聯。 每次您執行使用 admin 副檔名的腳本時,都必須使用/e 參數。
/h: cscript 將cscript.exe註冊為執行腳本的預設腳本主機。
/h: wscript.echo 將wscript.echo註冊為執行腳本的預設腳本主機。 這是省略 /h選項時的預設值。
/i 指定互動模式,以顯示警示、腳本錯誤和輸入提示。
這是預設值,與 /b相反。
/工作 x: 執行manage-bde.wsf腳本檔案中的識別碼所識別的作業。
/logo 指定在執行腳本之前,主控台中顯示 Windows 腳本主機橫幅。
這是預設值,與 /nologo相反。
/nologo 指定在腳本執行之前,不顯示 Windows Script 主機橫幅。 這與 /logo相反。
/s 儲存目前使用者的目前命令提示字元選項。
/t: 指定腳本可執行檔時間上限(以秒為單位)。 您最多可以指定32767秒。
預設值為 [無時間限制]。
/x 啟動偵錯工具中的腳本。
ScriptArguments 指定傳遞至腳本的引數。 每個腳本引數前面必須加上斜線(/)。
/? 在命令提示字元顯示 [說明]。

網頁伺服器(伺服器方面的VBS)

【用途】大多在 Active Server 派發遠端指令,使得很官方和非官方團體,喜歡分析他的指令和派發對象,因為可能經由【客端】逆向分析【伺服端】的漏洞。



整體的配套?發展向 .JS 語言。



=========================================================================


語言支持說明

https://documentation.help/VBScript-zh/vtoriVBScript.htm

編譯IDE軟體

https://sourceforge.net/projects/tagseditor/

=========================================================================

使用 登錄檔 關閉 Windows Script Host 使用


這個 Windows 腳本的副檔名支援相當廣泛,通常會有下列其中一個副檔名 manage-bde .wsf .vbs .js, .vbs, .vbe, .wsf, .wsc, .hta, .htm, .html, .asp

為限制運行.............先做點處理管理動作。

為了安全先處理這個,將單虛線內存檔為 wscript-off.reg 滑鼠點擊執行
-------------------------------------------------------------------------------------------------
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Script Host\Settings]
"DisplayLogo"="1"
"ActiveDebugging"="1"
"SilentTerminate"="0"
"UseWINSAFER"="1"
"enabled"="0"
-------------------------------------------------------------------------------------------------
想開啟 wscript 就把 "enabled"="1" 再次執行


=========================================================================


VBS基礎篇 - wscript 對象


一、wscript對象

描述:提供對 Windows 腳本宿主對像模型根對象的訪問。
詳述:WScript 對像是 Windows 腳本宿主對像模型層次結構的根對象。它可在任何腳本文件中使用,不需要特定的聲明。
WScript 對象提供對以下信息的訪問命令行參數, 腳本文件的名稱,宿主文件名, 宿主版本信息。
WScript 對象可用來創建對象,連接對象, 與對象斷開連接, 同步事件, 以編程方式停止腳本的執行,將信息輸出到默認輸出設備(Windows 對話框或命令控制台)。

WScript 對像也可用來設置腳本運行的模式(交互模式或批處理模式)。
就像剛才我們說的一樣,對象通過兩種其自有的特性想我們提供工具,這兩種特性分別是“屬性”和“方法”。

二、屬性

1、Arguments 屬性

描述:用於返回 Arguments 對象(這個對像我們以後會學,現在只需要了解就行)。
語法:object.Arguments
參數:object ,WScript 對象

例子:顯示本vbs文件運行的參數

Set Arg = WScript.Arguments
For i = 0 To Arg.Count - 1
MsgBox Arg(i)
Next

將上面這些代碼保存為vbs文件,然後將一個或者數個任意的文件拖放到這個vbs文件上面上,那麼他會逐個顯示你拖放的文件。 (這僅僅給出了一個實例,用到了Arguments對象,其的具體用法我們以後再了解)

2、FullName 屬性

描述:返回主機可執行文件(CScript.exe 或 WScript.exe)的完全限定路徑。
語法:object.FullName
參數:object ,WScript 對象

例子:顯示本機wscript的路徑
MsgBox wscript.fullname
在默認的情況下會顯示"C:\WINDOWS\system32\wscript.exe"

3、Interactive 屬性

描述:設置或確定腳本模式。
語法:object.Interactive
參數:object ,WScript 對象
說明:Interactive 屬性返回一個布爾值。

有批處理和交互兩種模式。在交互模式(默認模式)下,該腳本為用戶提供交互功能。啟用對 Windows 腳本宿主的輸入和輸出。該腳本可以將信息顯示在對話框中並等待用戶提供反饋。在批處理模式下,不支持這種類型的用戶交互,所有對 WSH 的輸入和輸出被禁用。還可以使用 Windows 腳本宿主命令行開關 / / I(對於交互式)和 / / B(對於批處理模式)來設置腳本模式。

例子:顯示本機的腳本模式
MsgBox WScript.Interactive

4、Name 屬性
描述:返回 WScript 對象(主機可執行文件)的名稱。
語法:object.Name
參數:object ,WScript 對象
例子:
MsgBox WScript.name

5、Path 屬性

描述:返回包含主機可執行文件(CScript.exe 或 WScript.exe)的路徑名稱
語法:object.Path
參數:object ,WScript 對象
例子:
MsgBox WScript.Path
如果你的wscript.exe是在”C: \ WINDOWS \ system32 \ wscript.exe“那麼本屬性會顯示”C: \ WINDOWS \ system32“

6、ScriptFullName 屬性

描述:返回當前運行腳本的完整路徑。
語法:object.ScriptFullName
參數:object ,WScript 對象
例子:顯示本vbs的完整路徑
MsgBox WScript.ScriptFullName

神奇吧,這個vbs竟然知道他自己的名字。

7、ScriptName 屬性

描述:返回當前運行腳本的文件名。
語法:object.ScriptName
參數:object ,WScript 對象
說明:剛才我們知道了用ScriptFullName可以獲取vbs文件自身的完整路徑,加入你只想要這個文件的名字改怎麼辦?看例子。
例子:顯示本VBS文件的名字
MsgBox WScript.ScriptName
怎麼樣?看到了嗎?

8、Version 屬性

描述:返回 Windows 腳本宿主的版本。
語法:object.Version
參數:object ,WScript 對象
例子:顯示本機腳本宿主版本
MsgBox WScript.version

三、方法

1、CreateObject方法

描述:創建一個對象
語法:CreateObject(appname.objecttype,[servername])
解釋:appname 必需的,Variant(字符串)。提供該對象的應用程序名。
objecttype 必需的;Variant(字符串)。待創建對象的類型或類。
servername 可選的; Variant (String). 要在其上創建對象的網絡服務器名稱。
說明:要創建 ActiveX 對象,只需將 CreateObject 返回的對象賦給一個對像變量:
Set ExcelSheet = CreateObject("Excel.Sheet")'的引用。
每個支持自動化的應用程序都至少提供一種對像類型。

例如,一個字處理應用程序可能會提供 Application 對象,Document 對象,以及 Toolbar 對象。要創建 ActiveX 對象,只需將 CreateObject 返回的對象賦給一個對像變量:

Dim ExcelSheet As Object'聲明一個對像變量來存放該對象
Set ExcelSheet = CreateObject("Excel.Sheet")
ExcelSheet.Application.Visible = True '設置 Application 對象使 Excel 可見
ExcelSheet.Cells(1, 1).Value = "This is column A, row 1"'在表格的第一個單元中寫些文本
ExcelSheet.SaveAs "C:\ TEST.xls"'將該表格保存到 C:\test.xls 目錄
ExcelSheet.Application.Quit'使用應用程序對象的 Quit 方法關閉 Excel。
Set ExcelSheet = Nothing'釋放該對像變量

上述代碼將啟動該應用程序創建該對象,在本例中就是創建一個 Microsoft Excel 電子數據表。對象創建後,就可以在代碼中使用自定義的對像變量來引用該對象。在下面的示例中,可以使用對像變量 ExcelSheet 來訪問新建對象的屬性和方法,以及訪問 Microsoft Excel 的其它對象,包括應用程序對象和單元格集合。

2、GetObject方法
描述:從文件中檢索一個 Automation 對象, 或檢索strProgID 參數所指定的對象
語法:object.GetObject(strPathname [,strProgID], [strPrefix])
參數:object必選項。 WScript 對象。
strPathname必選項。包含要獲取的對象的完整路徑和名稱。
strProgID可選項。表示對象的程序標識符(ProgID)的字符串。
strPrefix可選項。如果指定了參數 strPrefix,Windows 腳本宿 主將在創建對象之後把對象的輸出接口與腳本文件連接起來。在對像中觸發事件時,Windows 腳本宿主將調用一個子例程,其名稱包括 strPrefix 和事件的名稱。

例如,如果 strPrefix 為 "MYOBJ_",對象產生的事件為 "OnBegin,",那麼 Windows 腳本宿主將調用腳本中的 "MYOBJ_OnBegin" 子例程。

說明:如果當前存在對象的實例或者希望使用已經被裝載的文件創建對象,可使用 GetObject 方法。如果當前不存在實例,而且不希望從已經裝載的文件中啟動對象,請使用 CreateObject 方法。

如果一個對象將自己註冊為單實例對象(例如,Microsoft Word 7.0 中的 Word.Basic 對象),那麼無論執行 CreateObject 多少次也只能創建對象的一個實例。此外,對於單實例的對象,如果用零長度的字符串語法("")調用,GetObject 總是返回同樣的實例,而且如果省略路徑參數將導致錯誤。使用 GetObject 不能獲得對 Visual Basic 4.0 以及以前版本創建的 Microsoft Visual Basic(R)類的引用。

GetObject 適用於所有的 COM 類,不受創建對象所用語言的限制。

示例:在執行下列代碼時,與指定的 strPathname 相關聯的應用程序被啟動,指定文件中的對像被激活。如果 strPathname 是一個零長度的字符串 (""), GetObject 將返回指定類型的新對象實例。如果 strPathname 參數完全被省略,GetObject 將返回指定類型的當前活動對象。如果不存在指定類型的對象,將發生錯誤。

Dim MyObject As Object
Set MyObject = GetObject("C:\CAD\SCHEMA.CAD")
MyApp = MyObject.Application

某些應用程序允許激活一個文件的某些部分。如果要這樣做,需要在文件名後添加一個驚嘆號 (!),然後跟一個字符串,標識出文件中希望被激活的部分。關於如何創建該字符串的信息,請參閱創建對象的應用程序的有關文檔。

例如,在一個繪圖應用程序中,文件中存儲的一幅圖可能包含多層。可以使用下面的代碼激活繪圖文件中稱為 schema.cad 的一層:

Set LayerObject = GetObject("C:\CAD\SCHEMA.CAD!Layer3")

如果不指定對象的類,COM 將根據所提供的文件名來確定要啟動的應用程序和要激活的對象。但是,某些文件可能支持多個對像類。例如,一幅圖紙可能支持三種不同類型的對象:一個應用程序對象,一個繪圖對象,以及一個工具欄對象,它們都是同一個文件的組成部分。

在下例中,FIGMENT 是一個繪圖應用程序的名稱,DRAWING 是它支持的對像類型之一。

Dim MyObject As Object
Set MyObject = GetObject("C:\DRAWINGS\SAMPLE.DRW", "FIGMENT.DRAWING")



3、Quit 方法

描述:退出執行,返回指定的錯誤代碼。
語法:object.Quit [intErrorCode]
解釋:object 必選項。 WScript 對象。
intErrorCode可選項。如果包含此參數,WScript 將把它作為進程終止碼返回。如果省略了 intErrorCode,WScript 將返回零 (0) 作為進程終止碼。
例子:
下例退出執行並返回錯誤代碼 1:

WScript.Quit


4、Sleep 方法

描述:使腳本進程在指定的毫秒數內處於非活動狀態,然後繼續執行。
語法:object.Sleep(intTime)
參數:object必選項。 WScript 對象。
intTime腳本進程在非活動狀態的時間長度,以毫秒為單位。
說明:在睡眠狀態下,腳本將繼續執行所處理的事件。如果腳本引擎超時或被中斷,睡眠將立即結束。
例子:

wscript.sleep(3000)
Set apprun = CreateObject("wscript.shell")
apprun.run "%windir%\notepad.exe"

此例子將會延遲3秒啟動記事本。


5、timeout 方法

描述:設置腳本的生存時間
語法:wscript.timeout
例子:

wscript.timeout = 10
MsgBox "hello"



6、Echo 方法

描述:將輸出發送到對話框或控制台。
語法:object.Echo [Arg1] [,Arg2] [,Arg3] ...
參數:object必選項。 WScript 對象。
Arg1, Arg2, Arg3 ...所顯示的項的列表。
說明:如果宿主為 WScript.exe,本方法將把輸出顯示在對話框中;如果宿主為 CScript.exe,結果將顯示在控制台上。每一項將被一個空格隔開。在 CScript.exe 下,輸出的末尾被加上換行符。如果未提供任何項,顯示的將是空行。
例子:

Set fso = CreateObject("scripting.filesystemobject")
Set f = fso.OpenTextFile("c:\test.txt")
wscript.echo f.ReadAll

將會顯示這個文件裡面的所有內容。這麼看來,他的功能跟msgbox一樣,不過不如他強大。

7、ConnectObject 方法

描述:將一個對象事件源連接到具有給定前綴的函數。
語法:object.ConnectObject strObject, strPrefix
參數:object必選項。 WScript 對象。
strObject要連接的對象的名稱。
strPrefix事件函數的前綴。
說明:
對象必須能夠枚舉自己類的事件集合。


例子:下例實例化了一個假想的對象,並將其連接到腳本文件。然後腳本調用該對象的 "SomeMethod" 方法。如果對像中發生了名為 "Event"的事件,將調用 MyEvent_Event 子例程。

Set MyObject = WScript.CreateObject("SomeObject")
MyObject.SomeMethod
WScript.ConnectObject MyObject, "MyEvent"
Sub MyEvent_Event(strName)
WScript.Echo strName
End Sub
WScript.DisconnectObject MyObject


8、DisconnectObject 方法

描述:將原先與 Windows 腳本宿主連接的對象斷開。
語法:object.DisconnectObject obj
參數:object必選項。 WScript 對象。
obj要斷開連接的對象的名稱。
說明:
如果所指定的對象尚未被連接到 Windows 腳本宿主,則此方法不起任何作用。
例子:
下例創建了一個假想的對象並將其連接到腳本文件。然後腳本調用對象的 "SomeMethod" 方法。如果對像中發生名為 "Event" 的錯誤,MyEvent_Event 子例程將被調用。

Set MyObject = WScript.CreateObject("SomeObject", "MyEvent")
MyObject.SomeMethod
Sub MyEvent_Event(strName)
WScript.Echo strName
End Sub
WScript.DisconnectObject MyObject


=========================================================================


網路上流傳很廣的VBS工具,刪除過期檔案。


DeleteFolder.vbs

' ====== Code Start ===================

Option Explicit


WScript.Echo("作業開始執行:" & Date & " " & Time)


Dim FSO, agoDays, modifiedDate, delFolder


' 設定過期檔案預期天數

agoDays = 3

' 欲刪除檔案所在之目錄

delFolder = "D:\Temp"


Set FSO = CreateObject("Scripting.FileSystemObject")


modifiedDate = DateAdd("d", -agoDays, Date)


DelFilesInFolder FSO.GetFolder(delFolder)


Sub DelFilesInFolder(folder)

Dim file, subFolder


For Each file In folder.Files

If ((file.DateLastModified <= modifiedDate)) Then file.delete End If Next ' 如果遇到子目錄,也要進去檢查並刪除 For Each subFolder in folder.SubFolders DelFilesInFolder subFolder Next End Sub WScript.Echo("作業執行完畢:" & Date & " " & Time) ' ====== Code End =================== ========================================================================= HOME 前端開發



VBS InternetExplorer.Application的屬性和方法介紹


這是基於支持瀏覽器的功能,整體上來說?他並不新穎,甚至相當老舊1998年的產物,這對 WindowsCE 系統有語言支持。


示例程式碼

Set ie = CreateObject("InternetExplorer.Application")
ie.Navigate "url://www.xxxx"
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 “url://www.xxxx” ‘設定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
Event Description
BeforeNavigate Fires before navigation occurs in the given object (on either a window or frameset element).
BeforeNavigate2 Fires before navigation occurs in the given object (on either a window element or a frameset element).
CommandStateChange Fires when the enabled state of a command changes.
DocumentComplete Fires when a document is completely loaded and initialized.
DownloadBegin Fires when a navigation operation begins.
DownloadComplete Fires when a navigation operation finishes, is halted, or fails.
FileDownload 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.
NavigateComplete Fires after a navigation to a link is completed on either a window element or a frameSet element.
NavigateComplete2 Fires after a navigation to a link is completed on a window element or a frameSet element.
NavigateError Fires when an error occurs during navigation.
NewProcess Creates a new process to handle the navigation.
NewWindow Fires when a new window is to be created.
NewWindow2 Fires when a new window is to be created.
NewWindow3 Raised when a new window is to be created. Extends NewWindow2 with additional information about the new window.
OnFullScreen Fires when the FullScreen property is changed.
OnMenuBar Fires when the MenuBar property is changed.
OnQuit Fires before the Internet Explorer application quits.
OnStatusBar Fires when the StatusBar property is changed.
OnTheaterMode Fires when the TheaterMode property is changed.
OnToolBar Fires when the ToolBar property is changed.
OnVisible Fires when the Visible property of the object is changed.
PrintTemplateInstantiation Fires when a print template is instantiated.
PrintTemplateTeardown Fires when a print template is destroyed.
PrivacyImpactedStateChange Fired when an event occurs that impacts privacy, or when a user navigates away from a URL that has impacted privacy.
ProgressChange Fires when the progress of a download operation is updated on the object.
PropertyChange Fires when the PutProperty method of the object changes the value of a property.
RedirectXDomainBlocked Fired when a cross-domain redirect request is blocked.
SetPhishingFilterStatus Fires to indicate the progress and status of Microsoft Phishing Filter analysis of the current webpage.
SetSecureLockIcon Fires when there is a change in encryption level.
StatusTextChange Fires when the status bar text of the object has changed.
ThirdPartyUrlBlocked Fired when a third-party URL is blocked.
TitleChange Fires when the title of a document in the object becomes available or changes.
UpdatePageStatus Not implemented.
WindowActivate Not implemented.
WindowMove Not implemented.
WindowResize Not implemented.
WindowStateChanged Fires when the visibility state of a content window, such as the browser window or a tab, changes.

Methods
Method Description
ClientToWindow Computes the full size of the browser window when given the specified width and height of the content area.
ExecWB Executes a command and returns the status of the command execution using the IOleCommandTarget interface.
GetProperty Gets the value associated with a user-defined property name.
GoBack Navigates backward one item in the history list.
GoForward Navigates forward one item in the history list.
GoHome Navigates to the current home or start page.
GoSearch Navigates to the current search page.
Navigate Navigates to a resource identified by a URL or to a file identified by a full path.
Navigate2 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.
PutProperty Associates a user-defined name/value pair with the object.
QueryStatusWB Queries the object for the status of commands using the IOleCommandTarget interface.
Quit Closes the object.
Refresh Reloads the file that is currently displayed in the object.
Refresh2 Reloads the file that is currently displayed with the specified refresh level.
ShowBrowserBar Shows or hides a specified browser bar.
Stop Cancels a pending navigation or download, and stops dynamic page elements, such as background sounds and animations.

Properties
Property Description
AddressBar Sets or gets a value that indicates whether the address bar of the object is visible or hidden.
Application Gets the automation object for the application that is hosting the WebBrowser Control.
Busy Gets a value that indicates whether the object is engaged in a navigation or downloading operation.
Container Gets an object reference to a container.
Document Gets the automation object of the active document, if any.
FullName Retrieves the fully qualified path of the Internet Explorer executable.
FullScreen Sets or gets a value that indicates whether Internet Explorer is in full-screen mode or normal window mode.
Height Sets or gets the height of the object.
HWND Gets the handle of the Internet Explorer main window.
Left Sets or gets the coordinate of the left edge of the object.
LocationName Retrieves the path or title of the resource that is currently displayed.
LocationURL Gets the URL of the resource that is currently displayed.
MenuBar Sets or gets a value that indicates whether the Internet Explorer menu bar is visible.
Name Retrieves the frame name or application name of the object.
Offline Sets or gets a value that indicates whether the object is operating in offline mode.
Parent Gets the parent of the object.
Path Retrieves the system folder of the Internet Explorer executable.
ReadyState Gets the ready state of the object.
RegisterAsBrowser Sets or gets a value that indicates whether the object is registered as a top-level browser window.
RegisterAsDropTarget Sets or gets a value that indicates whether the object is registered as a drop target for navigation.
Resizable Sets or gets a value that indicates whether the object can be resized.
Silent Sets or gets a value that indicates whether the object can display dialog boxes.
StatusBar Sets or gets a value that indicates whether the status bar for the object is visible.
StatusText Sets or gets the text in the status bar for the object.
TheaterMode Sets or gets whether the object is in theater mode.
ToolBar Sets or gets whether toolbars for the object are visible.
Top Sets or gets the coordinate of the top edge of the object.
TopLevelContainer Gets a value that indicates whether the object is a top-level container.
Type Gets the user type name of the contained document object.
Visible Sets or gets a value that indicates whether the object is visible or hidden.
Width 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 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.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


=========================================================================


這種語言和 nod.js \ JS 算是同一個體系,他發展成一個很巨大的控制語言體系,甚至延伸到 Adobe Flash Play 的 .swf 語言來表現繪圖功能。



.

歡迎瀏覽 Blog (↓↑ 管理規範 ↑↓)

歡迎瀏覽 Blog (↓↑ 管理規範 ↑↓)

最新文章主題 http://hr-no.blogspot.com/ 閱覽

無任歡迎任何人,留言「張貼意見」讓我更明白?你想表達什麼!

一、書商勿擾,若有意恰,煩請等待?相關文章,請勿擅自擷取引用,若有引用?請標明出處,維護「倫理道德」。

二、若惡意引用本文,保留「法律追責」勿擅自認定解釋,本網也不另做解釋,但禁止影射認定,引起緋論。

三、基於保護當事人權益,不公開「公司行號、原始典故」,請各位閱讀者,自己另做思考。

四、本 Blog 發言,僅以 原始創作 網址 http://is-hr.blogspot.com/ 是唯一引導網址,其他轉載文章,恐有轉載者個人用意,請閱讀者多加確認網址,避免遭到「誤導」。


五、我希望維持「文章」在思維上該有的水準,因此?文章發表,將開始趨緩,儘可能的維持「十篇」的發稿量。

關於文章

HR-NO BlogSpot.com 2010 /06 /17近況:

有幾篇源自於「 http://is-hr.blogspot.com/ 」的原稿,我會在這一 HR NO當中進行描述,那些不屬於員工範圍的「工作型態」,反而與中高層的條件有關,預計?八十三節的文章,可能要「轉移約五十篇,在「下一個大主題:企業主的統御」上去;

這一個大主題:HR-NO在 2010 / 08 /09 增加到98篇儲稿。

還有增加的可能,來強調某種主題!

我會將這一年「12個月份、每月七節 + 外 N 節」妥善的完成。

因為這是我人生至今為止,最直接展示的社會現象。


釋出太多,被逼寫心得感想的人,別懷恨在心;聽說最少2000字,真假的?你們董事大人好狠心!

(建議:觀看者在寫心得時,最少要交 4000 字的心得報告,因為一個「高中生」都能交給我「滿滿 5600 字的工作心得,甚至描述各種工作現況」。)

當主管的人,做錯事,在期限前,有下面的人扛?那基層員工就是「背黑鍋、擔責任」錯誤永遠是「管理職、資深者」造成。

每月,固定釋出八章(含外節),因為我很多「錯別字」都還沒修訂! 請多包涵!

千萬不要找我當人資專員,我會玩殘很多「投機的人」。

明年預備的主題 Blog 「將關於BOSS的問題!」 明年豋場!

望能勉勵

不恨此山,不弒君。 仍志明;
不得天翼,不能斷。 仍天下;
不雪天下,不布武。 仍大海;
不能天地,不恨頭。 仍望優;

西元1997年六月讀完戰國策後......發瘋寫下的四言三緞。


大家都聽過.........
人嚇人會嚇死人;僅只有人會搞鬼!
搞得越大嚇死人;越來越多人嚇人!

我的特異能叫做「黑暗 Dark」而我也暱稱為 Dark Man

效能一:有光就有影,有影就有 Dark 之力,銷毀光明假象,創造文明知識未來。
效能二:當你凝視 Dark 時,Dark 將從四面八方包圍你。
效能三:Dark 不能說的秘密;會引起群眾恐慌!

以下問答,請在看完後,細細思量!你才能有所領悟!
別被表面的所帶過,請細細思量其中互動。

A
問答題:外星人近期,來過地球嗎?
解答是:外星人來過,但地球人的心智水準太低,根本不懂「接觸表徵」。

C
問答題:我寫得很順嗎?
解答是:以前寫過數個月的「長篇小說」,因此?寫起來還算順,但我不是「社工科系」出生,這些文章,全部都是「事實演化」有感而發描述。我也並未參考過任何「人資書籍」。

C2
問答題追加答案:
我若要將這個主題寫得好,就更不該去看「人資書籍」,而該閱讀更多實際案例,以案例情節;來撰寫事實。


D
問答題:你到底懂得多少東西?(看你YAHOO知識+的列表)(2013年後YAHOO知識家更新版本)
解答是:知無不言,言無不盡;只要我懂一分,就回答一分。

E
問答題:你到底會寫到什麼時候?( Blog spot )
解答是:你們相信嗎?現在寫的都是「綱要關係」,Dark Man 根本都還沒開始寫進入主題!

F
問答題:「孔子」周遊列國時,為何遭到追殺?
解答是:「孔子」率領近千百人,在列國諸侯之間引起戰亂,甚至進行武裝民兵叛變,列國諸侯能不殺「孔子」嗎?孔子不見得只是「禮教先師」,甚至可能是「恐怖份子」的祖師爺。

G
問答題:職場上「沒有友情」可以敘述嗎?
解答是:「對別人好一分,就是減少自己的好二分;這是資本主義所主張的行為。」因此?你要我如何在「資本策略的工作環境」上描述「友情」的行為?倒不如說「勾心鬥角」的逼迫?致使[ EQ ]成為一種毫無道德意識的容器。

H
問答題:Dark Man 到底是何方神聖?
解答是:從前有人描述我是「三頭六臂、凶神惡煞」?見過之後,才知道「別人賦予我,很深邃的黑暗。」

H2
修飾:我形容自己是「一座大海中的冰山,僅露出一小部分在海面上,讓人不知道冰山有多大!想要窺視冰山全貌的機會不多?除非你看見「冰山如 UFO 從海中升空飛馳而去。」當然,船隻撞上冰山?都沒有好結果,後面你們自己想像吧!