回复 34# yamakawa
看看那里不对
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <Misc.au3>
#include <WinAPIFiles.au3>
#include <File.au3>
#include <String.au3>
#include <Date.au3>
#include <GuiListView.au3>
#include <ListViewConstants.au3>
#include <GuiImageList.au3>
#include <StringConstants.au3>
Global $iWidtha = @DesktopWidth
Global $iHeighta = @DesktopHeight
Global $form1
Global $title = "电脑系统安装程序";南充理想
$form1 = GUICreate($title, 520, 497, -1, -1)
$disklist = GUICtrlCreateListView("", 15, 20, 490, 106, $LVS_REPORT, $WS_EX_CLIENTEDGE)
_guictrllistview_insertcolumn($disklist, 0, "编号", 40, 2)
_guictrllistview_insertcolumn($disklist, 1, "盘符", 40, 2)
_guictrllistview_insertcolumn($disklist, 2, "总共空间", 60, 2)
_guictrllistview_insertcolumn($disklist, 3, "剩余空间", 60, 2)
_guictrllistview_insertcolumn($disklist, 4, "分区类型", 60, 2)
_guictrllistview_insertcolumn($disklist, 5, "分区格式", 60, 2)
_guictrllistview_insertcolumn($disklist, 6, " ", 0, 2)
_guictrllistview_insertcolumn($disklist, 7, "引导类型", 60, 2)
_guictrllistview_insertcolumn($disklist, 8, "激活", 50, 2)
_fqxx()
GUISetState(@SW_SHOW)
While 1
$nmsg = GUIGetMsg()
Switch $nmsg
Case $gui_event_close;, $menuitem6
GUIDelete()
Exit
EndSwitch
WEnd
Func _fqxx()
Local $diskinfo = FileOpen(@ScriptDir & "\Partinfo.txt", 0)
Local $partinfo = FileRead($diskinfo)
$partinfo = StringRegExpReplace($partinfo, " ", " 无盘符 ")
$partinfo = StringRegExpReplace($partinfo, "Primary", "主分区")
$partinfo = StringRegExpReplace($partinfo, "Logical", "逻辑分区")
Local $aData = StringRegExp($partinfo, '(?mi)^(\d:\d)\s*(\S+)\s*(\S+)\s*(\S+)\s*(\S+)\s*(\S+)\s*(\S+)\s*(\S+)\s*(\d)\s*', 3)
_ArrayDisplay($aData)
Local $ii = 0
For $i = 0 To UBound($aData) - 1 Step 9
If $aData[$i + 8] = "1" Then
$aData[$i + 8] = "活动";"O"
Else
$aData[$i + 8] = "未激活";"X"
EndIf
GUICtrlCreateListViewItem($aData[$i] & "|" & $aData[$i + 1] & "|" & $aData[$i + 2] & "|" & $aData[$i + 3]& "|" & $aData[$i + 4]& "|" & $aData[$i + 5]& "|" & $aData[$i + 7]& "|" & $aData[$i + 8], $disklist)
Next
EndFunc ;==>fqxx
|