本帖最后由 天堂泪吻泪 于 2010-2-14 16:12 编辑
不知道为什么,选择了多文件,并且向list添加了数值,但自动退出了????还出现假死????
出现了以下提示:
"
If FileExists($files[$i]) Then GUICtrlSetData($List1,$files[1]&$files[$i+1]&"|")
If FileExists($files[$i]) Then GUICtrlSetData($List1,$files[1]&^ ERROR
"#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 434, 198, 209, 182)
$List1 = GUICtrlCreateList("", 8, 8, 313, 175)
$Button1 = GUICtrlCreateButton("Button1", 328, 16, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$file=FileOpenDialog("请选择文件:",@HomeDrive,"所有文件 (*.*)",4)
$files=StringSplit($file,"|")
For $i=1 To $files[0]
If FileExists($files[$i]) Then GUICtrlSetData($List1,$files[1]&$files[$i+1]&"|")
;MsgBox(0,"",$files[1]&$files[$i+1])
Next
EndSwitch
WEnd
问题已经解决了,并对后面的进行了不少修改,下面就可以了!#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 434, 198, 209, 182)
$List1 = GUICtrlCreateList("", 8, 8, 313, 175)
$Button1 = GUICtrlCreateButton("Button1", 328, 16, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$file = FileOpenDialog("请选择文件:", @HomeDrive, "所有文件 (*.*)", 4)
$files = StringSplit($file, "|")
If $files[0] = 1 Then
GUICtrlSetData($List1, $file)
Else
For $i = 1 To $files[0]
If $i <> $files[0] Then
If StringLen($files[1])=3 Then
$var = $files[1] & $files[$i + 1]
;MsgBox(0,"",$var)
Else
$var=$files[1]&""&$files[$i+1]
EndIf
GUICtrlSetData($List1, $var & "|")
EndIf
Next
EndIf
EndSwitch
WEnd
|