




已阅读5页,还剩33页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
5-1.VBS2 5-2.VBS4 5-3.VBS6 5-4.VBS8 5-5.VBS11 5-6.VBS13 5-7.VBS15 5-8.VBS18 5-9.VBS21 5-10.VBS24 5-11.VBS27 5-12.VBS30 5-13.VBS37 5-1.VBS -the following lines have been added to ensure all required COM objects are available on your system. script uses the following components: internetexplorer.application CheckCOM-end of COM-object checking code- set ie = CreateObject(InternetExplorer.Application)MsgBox Object Type: & TypeName(ie)ie.visible = trueMsgBox Internet Explorer is visible now!ie.visible = falseMsgBox Now its hidden!ie.Quit - the following code had been automatically added to ensure all required COM objects are installed.function COMExists(name) checks whether a specific COM object is installed on your local machineset cwsh = CreateObject(WScript.Shell)on error resume nextdummy = cwsh.RegRead(HKCR & name & )if err.number0 thenCOMExists = falseelseCOMExists = trueend ifend function sub CheckCOMif not COMExists(internetexplorer.application) thenmsg=COM-Object internetexplorer.application is required. This object is currently not installed on your system. & vbCrmsg = msg & Install the Internet Explorer Version 4.0 or above. & vbCrMsgBox msg, vbExclamationend ifend sub- end of COM object checking code (C) 2000 by Dr. T. Weltner - all rights reserved. 5-2.VBS -the following lines have been added to ensure all required COM objects are available on your system. script uses the following components: internetexplorer.application CheckCOM-end of COM-object checking code- set ie = CreateObject(InternetExplorer.Application)scriptname = WScript.ScriptFullNamepath = left(scriptname, InstrRev(scriptname, )filename = path & showme.htmMsgBox Now loading & filenameie.navigate filenameie.visible = trueMsgBox Internet Explorer is visible now!, vbSystemModalMsgBox Type of document: & TypeName(ie.document)ie.Quit - the following code had been automatically added to ensure all required COM objects are installed.function COMExists(name) checks whether a specific COM object is installed on your local machineset cwsh = CreateObject(WScript.Shell)on error resume nextdummy = cwsh.RegRead(HKCR & name & )if err.number0 thenCOMExists = falseelseCOMExists = trueend ifend function sub CheckCOMif not COMExists(internetexplorer.application) thenmsg=COM-Object internetexplorer.application is required. This object is currently not installed on your system. & vbCrmsg = msg & Install the Internet Explorer Version 4.0 or above. & vbCrMsgBox msg, vbExclamationend ifend sub- end of COM object checking code (C) 2000 by Dr. T. Weltner - all rights reserved. 5-3.VBS -the following lines have been added to ensure all required COM objects are available on your system. script uses the following components: internetexplorer.application scripting.filesystemobject CheckCOM-end of COM-object checking code- set ie = CreateObject(InternetExplorer.Application)title = My Output Windowpage = JavaScript: & title _ & ie.navigate page wait for the page to be fully initialized:doloop while ie.ReadyState4 show page:ie.visible = true now you can dynamically change content:content = InputBox(Please enter some text!)ie.document.body.innerHTML = & content & MsgBox I will now list all files on drive C:! list all filesset fs = CreateObject(Scripting.FileSystemObject)set folder = fs.GetFolder(C:)for each file in folder.files ie.document.body.insertAdjacentHTML beforeEnd, _ & next - the following code had been automatically added to ensure all required COM objects are installed.function COMExists(name) checks whether a specific COM object is installed on your local machineset cwsh = CreateObject(WScript.Shell)on error resume nextdummy = cwsh.RegRead(HKCR & name & )if err.number0 thenCOMExists = falseelseCOMExists = trueend ifend function sub CheckCOMif not COMExists(internetexplorer.application) thenmsg=COM-Object internetexplorer.application is required. This object is currently not installed on your system. & vbCrmsg = msg & Install the Internet Explorer Version 4.0 or above. & vbCrMsgBox msg, vbExclamationend ifif not COMExists(scripting.filesystemobject) thenmsg=COM-Object scripting.filesystemobject is required. This object is currently not installed on your system. & vbCrmsg = msg & Reinstall the Windows Scripting Host! & vbCrMsgBox msg, vbExclamationend ifend sub- end of COM object checking code (C) 2000 by Dr. T. Weltner - all rights reserved. 5-4.VBS -the following lines have been added to ensure all required COM objects are available on your system. script uses the following components: internetexplorer.application scripting.filesystemobject CheckCOM-end of COM-object checking code- this statement invokes the event sink feature:set ie = WScript.CreateObject(InternetExplorer.Application, _ event_)title = My Output Windowpage = JavaScript: & title _ & ie.navigate page wait for the page to be fully initialized:doloop while ie.ReadyState4 show page:ie.visible = true now you can dynamically change content:content = InputBox(Please enter some text!)ie.document.body.innerHTML = & content & MsgBox I will now list all files on drive C:! list all filesset fs = CreateObject(Scripting.FileSystemObject)set folder = fs.GetFolder(C:)for each file in folder.files ie.document.body.insertAdjacentHTML beforeEnd, _ & next this procedure executes once the IE Quit event is fired:sub event_onQuit MsgBox Hey! You closed my output window!, vbExclamation WScript.Quitend sub - the following code had been automatically added to ensure all required COM objects are installed.function COMExists(name) checks whether a specific COM object is installed on your local machineset cwsh = CreateObject(WScript.Shell)on error resume nextdummy = cwsh.RegRead(HKCR & name & )if err.number0 thenCOMExists = falseelseCOMExists = trueend ifend function sub CheckCOMif not COMExists(internetexplorer.application) thenmsg=COM-Object internetexplorer.application is required. This object is currently not installed on your system. & vbCrmsg = msg & Install the Internet Explorer Version 4.0 or above. & vbCrMsgBox msg, vbExclamationend ifif not COMExists(scripting.filesystemobject) thenmsg=COM-Object scripting.filesystemobject is required. This object is currently not installed on your system. & vbCrmsg = msg & Reinstall the Windows Scripting Host! & vbCrMsgBox msg, vbExclamationend ifend sub- end of COM object checking code (C) 2000 by Dr. T. Weltner - all rights reserved. 5-5.VBS -the following lines have been added to ensure all required COM objects are available on your system. script uses the following components: typelib.decoder scripting.dictionary CheckCOM-end of COM-object checking code- set typelib = CreateObject(typelib.decoder) use a dictionary to keep track of duplicate entries:set dict = CreateObject(scripting.dictionary) check interfaces defined in this file:typelibfile = shdocvw.dll enumerate available interfaces:set interfaces = typelib.GetInterfaces(typelibfile)list = Interfaces in & typelibfile & : & vbCr & vbCr read all interfaces and put into list:for each interface in interfaces check whether entry is a duplicate entry: if not dict.Exists(interface) then add to list only if new entry dict.Add interface, 0 list = list & interface & vbCr end ifnextMsgBox list - the following code had been automatically added to ensure all required COM objects are installed.function COMExists(name) checks whether a specific COM object is installed on your local machineset cwsh = CreateObject(WScript.Shell)on error resume nextdummy = cwsh.RegRead(HKCR & name & )if err.number0 thenCOMExists = falseelseCOMExists = trueend ifend function sub CheckCOMif not COMExists(typelib.decoder) thenmsg=COM-Object typelib.decoder is required. This object is currently not installed on your system. & vbCrmsg = msg & Install the TYPELIB component from CD & vbCrMsgBox msg, vbExclamationend ifif not COMExists(scripting.dictionary) thenmsg=COM-Object scripting.dictionary is required. This object is currently not installed on your system. & vbCrmsg = msg & Reinstall the Windows Scripting Host! & vbCrMsgBox msg, vbExclamationend ifend sub- end of COM object checking code (C) 2000 by Dr. T. Weltner - all rights reserved. 5-6.VBS -the following lines have been added to ensure all required COM objects are available on your system. script uses the following components: typelib.decoder wscript.shell CheckCOM-end of COM-object checking code- set typelib = CreateObject(typelib.decoder)set wshshell = CreateObject(WScript.Shell) This is the Type Library responsible for IE:module = shdocvw.dll This is the module we are interested in:interface = DWebBrowserEvents2 list content:set result = typelib.EnumInterface(module, interface)for each entry in result entry = Split(entry, vbTab) list = list & entry(0) & vbCr & & entry(1) & & vbCrnextwshshell.Popup list - the following code had been automatically added to ensure all required COM objects are installed.function COMExists(name) checks whether a specific COM object is installed on your local machineset cwsh = CreateObject(WScript.Shell)on error resume nextdummy = cwsh.RegRead(HKCR & name & )if err.number0 thenCOMExists = falseelseCOMExists = trueend ifend function sub CheckCOMif not COMExists(typelib.decoder) thenmsg=COM-Object typelib.decoder is required. This object is currently not installed on your system. & vbCrmsg = msg & Install the TYPELIB component from CD & vbCrMsgBox msg, vbExclamationend ifif not COMExists(wscript.shell) thenmsg=COM-Object wscript.shell is required. This object is currently not installed on your system. & vbCrmsg = msg & Reinstall the Windows Scripting Host! & vbCrMsgBox msg, vbExclamationend ifend sub- end of COM object checking code (C) 2000 by Dr. T. Weltner - all rights reserved. 5-7.VBS -the following lines have been added to ensure all required COM objects are available on your system. script uses the following components: scripting.filesystemobject internetexplorer.application CheckCOM-end of COM-object checking code- Open IE Window without scroll barset window = OpenWindow(My Output Window, false) use window:content = InputBox(Please enter some text!)PrintNew window, & content & MsgBox I will now list all files on drive C:! list all filesset fs = CreateObject(Scripting.FileSystemObject)set folder = fs.GetFolder(C:)for each file in folder.files Print window, & nextsub event_onQuit MsgBox Hey! You closed my output window!, vbExclamation WScript.Quitend subfunction OpenWindow(title, scrolling)set ie = WScript.CreateObject(InternetExplorer.Application, _event_) add attribute to body-tag to hide scroll bar if appropriate: if scrolling then scroller = scroll = no end ifpage = JavaScript: & title _ & ie.navigate page turn off toolbars ie.Toolbar = false turn off status bar ie.Statusbar = falsedoloop while ie.ReadyState4ie.visible = true return reference to IE object: Set OpenWindow = ieend functionsub PrintNew(obj, text) obj.document.body.innerHTML = textend subsub Print(obj, text) obj.document.body.insertAdjacentHTML beforeEnd, textend sub - the following code had been automatically added to ensure all required COM objects are installed.function COMExists(name) checks whether a specific COM object is installed on your local machineset cwsh = CreateObject(WScript.Shell)on error resume nextdummy = cwsh.RegRead(HKCR & name & )if err.number0 thenCOMExists = falseelseCOMExists = trueend ifend function sub CheckCOMif not COMExists(scripting.filesystemobject) thenmsg=COM-Object scripting.filesystemobject is required. This object is currently not installed on your system. & vbCrmsg = msg & Reinstall the Windows Scripting Host! & vbCrMsgBox msg, vbExclamationend ifif not COMExists(internetexplorer.application) thenmsg=COM-Object internetexplorer.application is required. This object is currently not installed on your system. & vbCrmsg = msg & Install the Internet Explorer Version 4.0 or above. & vbCrMsgBox msg, vbExclamationend ifend sub- end of COM object checking code (C) 2000 by Dr. T. Weltner - all rights reserved. 5-8.VBS -the following lines have been added to ensure all required COM objects are available on your system. script uses the following components: scripting.filesystemobject internetexplorer.application CheckCOM-end of COM-object checking code- set window = OpenWindow(My Output Window, 400, 200)content = InputBox(Please enter some text!)PrintNew window, & content & MsgBox I will now list all files on drive C:! list all filesset fs = CreateObject(Scripting.FileSystemObject)set folder = fs.GetFolder(C:)for each file in folder.files Print window, & nextsub event_onQuit MsgBox Hey! You closed my output window!, vbExclamation WScript.Quitend subfunction OpenWindow(title, width, height)set ie = WScript.CreateObject(InternetExplorer.Application, _event_)page = JavaScript: & title _ & ie.navigate page ie.Toolbar = false ie.Statusbar = falsedoloop while ie.ReadyState4 screenWidth = ie.document.parentWindow.screen.availWidth screenHeight = ie.document.parentWindow.screen.availHeight limit size to max avail space if widthscreenWidth then width=screenWidth if heightscreenHeight then height=screenHeight ie.Width = width ie.Height = height ie.left = Fix(screenWidth - width)/2) ie.top = Fix(screenHeight - height)/2)ie.visible = true return reference to IE object: Set OpenWindow = ieend functionsub PrintNew(obj, text) obj.document.body.innerHTML = textend subsub Print(obj, text) obj.document.body.insertAdjacentHTML beforeEnd, textend sub - the following code had been automatically added to ensure all required COM objects are installed.function COMExists(name) checks whether a specific COM object is installed on your local machineset cwsh = CreateObject(WScript.Shell)on error resume nextdummy = cwsh.RegRead(HKCR & name & )if err.number0 thenCOMExists = falseelseCOMExists = trueend ifend function sub CheckCOMif not COMExists(scripting.filesystemobject) thenmsg=COM-Object scripting.filesystemobject is required. This object is currently not installed on your system. & vbCrmsg = msg & Reinstall the Windows Scripting Host! & vbCrMsgBox msg, vbExclamationend ifif not COMExists(internetexplorer.application) thenmsg=COM-Object internetexplorer.application is required. This object is currently not installed on your system. & vbCrmsg = msg & Install the Internet Explorer Version 4.0 or above. & vbCrMsgBox msg, vbExclamationend ifend sub- end of COM object checking code (C) 2000 by Dr. T. Weltner - all rights reserved. 5-9.VBS -the following lines have been added to ensure all required COM objects are available on your system. script uses the following components: internetexplorer.application CheckCOM-end of COM-object checking code- global variable will report entered text:enteredText = open window:set window = OpenWindow(dialog.htm, 400, 300) hook up event handler:window.document.all.myButton.onClick = GetRef(buttonclick) display MsgBox to halt the script and wait for inputWScript.Sleep 2000MsgBox Press OK to read dialog box., vbSystemModal see what the user has typed in:MsgBox This is what you entered: & enteredText event procedure responds to button click:sub buttonclick someone clicked the button! read entered text enteredText = window.document.all.myInput.value close window window.Quitend subfunction OpenWindow(filename, width, height)set ie = CreateObject(InternetExplorer.Application)scriptname = WScript.ScriptFullNamepath = left(scriptname, InstrRev(scriptname, )filepath = path & filenameie.navigate filepath ie.Toolbar
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 年前安全检查培训课件
- 重庆公务员考试真题2025
- 北京考公2025真题
- 快消品代理协议5篇
- 年关食品安全培训课件
- FITC-LC-TAT-47-57-acetate-生命科学试剂-MCE
- 沈阳事业单位笔试真题2025
- 宁夏公考真题2025
- 郴州汝城县事业单位招聘笔试真题2024
- 2025年那曲市事业单位考试真题
- 智能化设计资源管理-洞察及研究
- 2025股权融资合同书
- 2025员工试用期合同协议书模板
- 供电服务技巧培训
- 渝22TS02 市政排水管道附属设施标准图集 DJBT50-159
- GA/T 1439-2017法庭科学复印文件检验技术规程
- 惠普云教室用户操作手册
- 《护理实习手册》【范本模板】
- 油浸式变压器技术参数和要求
- 土石坝3D建造无人驾驶碾压新技术
- 大数据技术创新与实践
评论
0/150
提交评论