我用笨的办法来弄的
Local $CoLS = _FileReadLinesToArray("ChkSpace.txt")
Local $str
For $i = 1 To $CoLS[0] - 1
If $CoLS[$i] <> "" And Not StringInStr($CoLS[$i], "-") And Not StringInStr($CoLS[$i], "'") Then
Local $TbSp = StringMid($CoLS[$i], StringInStr($CoLS[$i], " ", "", 1) + 1, StringInStr($CoLS[$i], " ", "", 2) - StringInStr($CoLS[$i], " ", "", 1) - 1)
If $TbSp <> "SYSTEM" And $TbSp <> "SYSAUX" And $TbSp <> "USERS" And $TbSp <> "TEMP" And $TbSp <> "UNDOTBS1" Then
$str &= $TbSp & @CRLF
EndIf
EndIf
Next
MsgBox(0, 0, $str)
Func _FileReadLinesToArray($sFilePath)
Local $hFile = FileOpen($sFilePath, 0)
If $hFile = -1 Then Return SetError(1, 0, 0)
Local $sFileContent = StringStripWS(FileRead($hFile), 2)
FileClose($hFile)
Local $aTmp
If StringInStr($sFileContent, @LF) Then
$aTmp = StringSplit(StringStripCR($sFileContent), @LF)
ElseIf StringInStr($sFileContent, @CR) Then
$aTmp = StringSplit($sFileContent, @CR)
Else
If StringLen($sFileContent) Then
Return 1
Else
Return SetError(2, 0, 0)
EndIf
EndIf
Return $aTmp
EndFunc ;==>_FileReadLinesToArray
|