Local $Str = _
'[Summary]' & @CRLF & _
'Partitions|Partition1=C: (NTFS) 30004 MB (19314 MB free)' & @CRLF & _
'Partitions|Partition2=D: (NTFS) 25603 MB (24223 MB free)' & @CRLF & _
'Partitions|Partition3=E: (NTFS) 230000 MB (87171 MB free)' & @CRLF & _
'Partitions|Partition4=F: (NTFS) 216932 MB (160868 MB free)' & @CRLF & _
'Partitions|Partition5=G: (NTFS) 226314 MB (151415 MB free)' & @CRLF & _
'Partitions|Partition6=H: (NTFS) 225019 MB (36250 MB free)' & @CRLF & _
'Partitions|Partition7=X: (NTFS) 112639 MB (2014 MB free)' & @CRLF & _
'Partitions|Total Size=1041.5 GB (470.0 GB free)' & @CRLF
Local $Test = StringRegExp($Str, '(.):\h\((.+?)\)\h([^(]+)\h\((.+?)\hfree', 3)
#include <ListViewConstants.au3>
GUICreate('Form1', 623, 449)
$ListView = GUICtrlCreateListView('盘符|可用磁盘|磁盘大小|分区格式', 56, 72, 433, 233)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 70)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 120)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 120)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 120)
For $i = 0 To UBound($Test) - 1 Step 4
GUICtrlCreateListViewItem($Test[$i] & '|' & $Test[$i + 3] & '|' & $Test[$i + 2] & '|' & $Test[$i + 1], $ListView)
Next
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
EndSwitch
WEnd
|