feicuiboy 发表于 2010-4-21 12:46:46

FileExists无法判断畸形文件夹是否存在

if FileExists("C:\2\123..\") then
                msgbox(0,"1","存在")
        else
                msgbox(0,"","不存在")
        EndIf
        上述代码无法判断畸形文件夹,当123..\时候可以,当123...\(3个点)时候就无法判断,
大家有什么好方法来判断畸形文件夹存在与否?

caodongchun 发表于 2010-4-21 20:51:50

#Include <WinAPI.au3>
$sFileName = 'c:\123...\123.txt'
_WinAPI_CreateFile($sFileName,0)
FileWrite($sFileName,'123123')
MsgBox(0,FileRead($sFileName),_WinAPI_CreateFile($sFileName, 2))

caodongchun 发表于 2010-4-21 21:46:11

本帖最后由 caodongchun 于 2010-4-21 21:47 编辑

If FileGetAttrib ("C:\123...\")<>'' Then

        MsgBox(0, "1", "存在")

Else

        MsgBox(0, "", "不存在")

EndIf
页: [1]
查看完整版本: FileExists无法判断畸形文件夹是否存在