怎样判断目录是否存在

解决方案 »

  1.   

    function DirectoryExists(const Directory: string): Boolean;DescriptionCall DirectoryExists to determine whether the directory specified by the Name parameter exists. If the directory exists, the function returns True. If the directory does not exist, the function returns False.If a full path name is entered, DirectoryExists searches for the directory along the designated path. Otherwise, the Name parameter is interpreted as a relative path name from the current directory.Note: DirectoryExists is also found in the FileCtrl unit.
      

  2.   

    用DirectoryExists函数判断即可,它有一个参数,就是你要判断的路径
      

  3.   

    if DirectoryExists('c:\temp') then
       showmessage('存在')
    else
       showmessage('不存在')
      

  4.   

    if DirectoryExists('c:\temp') then
       showmessage('存在')
    else
       showmessage('不存在')