本帖最后由 wsfda 于 2011-5-7 18:15 编辑 #include <Array.au3>
$aArray = _GetPSTPath()
$string = ""
FOR $element IN $aArray
$string = $string & $element & @CRLF
NEXT
Msgbox(0,"For..IN 数组测试","结果: " & @CRLF & $string)
Func _GetPSTPath()
Local $sFolderSubString, $sPath, $asPathSearch, $sReturn
Local $oOutlook = ObjCreate("Outlook.Application")
Local $oNS = $oOutlook.GetNamespace("MAPI")
If IsObj($oNS) Then
For $objFolder In $oNS.Folders
$sPath = ""
For $i = 1 To StringLen($objFolder.StoreID) Step 2
$sFolderSubString = StringMid($objFolder.StoreID, $i, 2)
If $sFolderSubString <> "00" Then $sPath &= Chr(Dec($sFolderSubString))
Next
$asPathSearch = StringRegExp($sPath, "(?i)\w(:\\|\\\\)\w.*[pst]", 2)
If IsArray($asPathSearch) Then $sReturn &= $asPathSearch[0] & Chr(28)
Next
Return StringSplit(StringTrimRight($sReturn, 1), Chr(28))
Else
SetError(1)
Return 0
EndIf
EndFunc
以上代码运行后得出的结果中出现了一个“3” 如下:
请教这个3是怎么回事,不能理解他如何产生的,求教,谢谢各位.... |