VBS檢視物件資訊

2021-05-28 14:35:54 字數 3666 閱讀 1275

const forreading = 1 '以唯讀模式開啟檔案。不能對此檔案進行寫操作。

const forwriting = 2 '以可讀寫模式開啟檔案。如果已存在同名的檔案,則覆蓋舊的檔案。

dim fso

set fso = createobject("scripting.filesystemobject")

set infooutputfile = fso.getfile("tlbinfo.ini") '設定乙個檔案物件..filepath就是這個模板檔案的名稱

set infolog = infooutputfile.openastextstream(forwriting) '設定乙個文字物件..並開啟這個物件...

set info = tli.typelibinfofromfile("tlbinf32.dll")

infolog.write "#-----------------tlbinf32.dll-----------------" & vbcrlf

infolog.write "[baseinfo]" & vbcrlf

infolog.write "name=" & info.name & vbcrlf

infolog.write "containingfile=" & info.containingfile & vbcrlf

infolog.write "helpstring=" & info.helpstring & vbcrlf

infolog.write "helpstringdll=" & info.helpstringdll & vbcrlf

infolog.write "helpfile=" & info.helpfile & vbcrlf

infolog.write "guid=" & info.guid & vbcrlf

infolog.write "majorversion=" & info.majorversion & vbcrlf

infolog.write "minorversion=" & info.minorversion & vbcrlf

infolog.write "attributemask=" & info.attributemask & vbcrlf

'if not (info.attributestrings is nothing) then

' infolog.write "attributestrings=" & info.attributestrings & vbcrlf

'end if

'infolog.write "attributestrings=" & info.attributestrings & vbcrlf

infolog.write "libnum=" & info.libnum & vbcrlf

infolog.write "showlibname=" & info.showlibname & vbcrlf

infolog.write vbcrlf

iname = ""

for each inte***ce in info.inte***ces

iname = iname & inte***ce.name & vbcrlf

next

infolog.write "[inte***ces]" & vbcrlf & iname & vbcrlf

tname = ""

for each typeinfo in info.typeinfos

pname = pname & typeinfo.name & vbcrlf

next

infolog.write "[typeinfos]" & vbcrlf & pname & vbcrlf

cocname = ""

for each coclass in info.coclasses

cocname = cocname & coclass.name & vbcrlf

next

infolog.write "[coclasses]" & vbcrlf & cocname & vbcrlf

constantname = ""

for each constant in info.constants

constantname = constantname & constant.name & vbcrlf

next

infolog.write "[constants]" & vbcrlf & constantname & vbcrlf

declarationname = ""

for each declaration in info.declarations

declarationname = declarationname & declaration.name & vbcrlf

next

infolog.write "[declarations]" & vbcrlf & declarationname & vbcrlf

recordname = ""

for each record in info.records

recordname = recordname & record.name & vbcrlf

next

infolog.write "[records]" & vbcrlf & recordname & vbcrlf

intrinsicaliasname = ""

for each intrinsicalias in info.intrinsicaliases

intrinsicaliasname = intrinsicaliasname & intrinsicalias.name & vbcrlf

next

infolog.write "[intrinsicaliases]" & vbcrlf & intrinsicaliasname & vbcrlf

customdataname = ""

for each customdata in info.customdatacollection

customdataname = customdataname & customdata.name & vbcrlf

next

infolog.write "[customdatacollection]" & vbcrlf & customdataname & vbcrlf

unionname = ""

for each union in info.unions

unionname = unionname & union.name & vbcrlf

next

infolog.write "[unions]" & vbcrlf & unionname & vbcrlf

mname = ""

for each coclass in info.coclasses

infolog.write "[" & coclass.name & "]" & vbcrlf

for each member in coclass.defaultinte***ce.members

mname = mname & member.name & vbcrlf

next

infolog.write mname & vbcrlf & vbcrlf

next

infolog.close

VBS獲取硬體資訊

標題 msgbox 北京漢獅裝置盤點使用 製作人 jason凱伊 請輸入您的姓名 while name name inputbox 請輸入你中文名字 盤點資訊 姓名 wend 請輸入所在部門 例子 while dept dept inputbox 請輸入你所在的部門 盤點資訊 部門 wend 請輸入...

python檢視物件的方法 獲取物件資訊

當我們拿到乙個物件的引用時,如何知道這個物件是什麼型別 有哪些方法呢?使用type 首先,我們來判斷物件型別,使用type 函式 基本型別都可以用type 判斷 type 123 type str type none 如果乙個變數指向函式或者類,也可以用type 判斷 type abs type a...

VBS基礎篇 RegExp 物件

正規表示式 regexp 物件 下面的 說明了regexp物件的用法 function regexptest patrn,strng dim regex,match,matches 建立變數 set regex new regexp 建立正規表示式 regex.pattern patrn 設定模式 ...