查阅了很多关于调用ini的举例终于把这句Local $sFile = '硬件.ini' 写出用ini配置了
ini内容如下
[config]
1=\\192.168.2.247\info$\硬件.ini
现在完整代码如下,哪位大侠在帮帮我加入内存大小共几条啊#include 'DIY_RegInfo.au3'
Local $sFile = IniRead(@ScriptDir & "\config.ini", "config", 1, 1)
IniWrite($sFile, '硬件信息', @ComputerName, '主板:' & _MbGet() & ',处理器:' & _CpuGet() & ',显卡:' & _VGAGet() & ',声卡:' & _Realinfo() & @CRLF)
;;;以下为读取
Local $sInfo = IniRead($sFile, '硬件信息', @ComputerName, '读取错误')
MsgBox(0, '', $sInfo)
Func _MbGet()
Local $objWMIService = ObjGet('winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2')
Local $colBoard = $objWMIService.ExecQuery('SELECT * FROM Win32_BaseBoard')
For $object In $colBoard
Local $mb = $object.Product
Next
Return $mb
EndFunc ;==>_MbGet
|