' 標題
msgbox "北京漢獅裝置盤點使用 製作人:jason凱伊"
'請輸入您的姓名
while name=""
name=inputbox("請輸入你中文名字:","盤點資訊-姓名")
wend
' 請輸入所在部門 例子:
while dept=""
dept=inputbox("請輸入你所在的部門:","盤點資訊-部門")
wend
' 請輸入您有幾台電腦
while pc=""
pc=inputbox("請輸入辦公電腦數量 ,例子:1臺 ","盤點資訊-電腦數量")
wend
'請輸入您除了電腦,其他裝置
while other=""
other=inputbox("請輸入其他型號名稱 例子:顯示器、usb轉接器、行動硬碟等,如果沒有,填寫沒有或者否即可","盤點資訊-其他裝置")
wend
' 輸出檔案格式
files =".\\" &dept&"-"&name&".txt"
set fso = createobject("scripting.filesystemobject")
set files = fso.createtextfile(files,true)
set wmi=getobject("winmgmts:")
set board = wmi.instancesof("win32_baseboard")
for each b in board
msg =msg& "裝置型號: "
msg = msg+b.product
product = msg
next
msg=msg&chr(13)&chr(13)
set sn = wmi.instancesof("win32_bios")
for each s in sn
msg = msg&"bios序列號:"
msg = msg+s.serialnumber
bios = msg
next
msg=msg&chr(13)&chr(13)
set cpu = wmi.instancesof("win32_processor")
for each u in cpu
msg = msg&"cpu型號: "
msg = msg+u.name
processor = msg
next
msg=msg&chr(13)&chr(13)
set mem = wmi.instancesof("win32_computersystem")
for each m in mem
msg = msg&"記憶體總容量 :"
msg = msg& round((m.totalphysicalmemory/1024^3),2)&"g"
next
msg=msg&chr(13)&chr(13)
set disks=wmi.instancesof("win32_diskdrive")
for each d in disks
n= round(d.size/(1024^3),2)&"g"
msg = msg&"硬碟總容量:"
msg = msg+n
diskdrive = msg
next
msg=msg&chr(13)&chr(13)
set display = wmi.instancesof("win32_videocontroller")
for each video in display
msg = msg&"顯示卡型號 :"
msg = msg +video.name
controller = msg
next
msg=msg&chr(13)&chr(13)
set system =wmi.instancesof("win32_operatingsystem")
for each sys in system
msg = msg&"系統版本 :"
msg = msg+sys.version
operation = msg
next
msg=msg&chr(13)&chr(13)&chr(13)
msg = msg&"所在部門 :"
msg = msg+dept
msg=msg&chr(13)
msg = msg&"提交姓名 :"
msg = msg+name
msg=msg&chr(13)&chr(13)&chr(13)&chr(13)&chr(13)&chr(13)
msg = chr(13)&msg& "確定"
'輸出結果
name = "姓名: "&name
dept = "部門: "&dept
pc = "電腦數量: "&pc
other = "其他裝置: "& other&chr(13)&chr(13)
files.writeline(dept)
files.writeline(name)
files.writeline(pc)
files.writeline(other)
files.writeline(operation)
files.close
msgbox msg,0,"盤點裝置預覽表"
msgbox "盤點資訊資料已經生成,請小夥伴動動手指,將生成的檔案傳送給張凱毅 ^_^"
c 獲取硬體資訊
using system using system.runtime.interopservices using system.management namespace hardware 取cpu編號 public string getcpuid return strcpuid catch end m...
c 獲取硬體資訊
using system using system.runtime.interopservices using system.management namespace hardware 取cpu編號 public string getcpuid return strcpuid catch end m...
C 獲取硬體資訊
using system using system.net using system.runtime.interopservices using system.management 需要在解決方案中引用system.management.dll檔案 獲取機器名 public string getho...