如何检测文件夹是否存在(API)
如何检测文件夹是否存在(API,不要fso,不要dir)

解决方案 »

  1.   

    奇怪,dir这么简单不用?
    If Dir("c:\temp", vbDirectory) <> "" Then
      

  2.   

    http://expert.csdn.net/Expert/topic/2661/2661062.xml?temp=.3587152
      

  3.   

    FileExits,我现在在网吧,不能给你完整的声明,等回去后再给你。
      

  4.   

    '我用的Win2000'判断指定的文件或文件夹是否存在
    Private Declare Function PathFileExists Lib "shlwapi.dll" Alias "PathFileExistsA" (ByVal pszPath As String) As Long'文件或文件夹是否存在
    Private Function FileExists(ByVal sFile As String) As Boolean
      FileExists = CBool(PathFileExists(sFile))
    End FunctionPrivate Sub Form_Load()
    Me.AutoRedraw = True
    Print """c:\winnt"": " & FileExists("c:\winnt")
    Print """c:\winnt\"": " & FileExists("c:\winnt\")
    Print """c:\wint"": " & FileExists("c:\wint")
    Print """c:\wint\"": " & FileExists("c:\wint\")
    Print """c:\winnt\explorer.exe"": " & FileExists("c:\winnt\explorer.exe")
    Print """c:\winnt\explorer2.exe"": " & FileExists("c:\winnt\explorer2.exe")
    End Sub