路径:"c:\myimg\"
现在想实现按一下按钮就检查有没有以上路径,呵如果没有此呼路径就弹出窗口提示“找不到路径”如果有此路径,呵就在此目录下新建一文件temp.htm

解决方案 »

  1.   

    var 
      sl: TStringlist;
    begin
      SL := TStringlist.Create;
      try
        if not DirectoryExists(Path) then
           SL.Savetofile(Path + 'temp.htm')
        else
          showmessage('存在');
      finally
        SL.free;
      end;
    end;
      

  2.   

    呵呵,反了
    var 
      sl: TStringlist;
    begin
      SL := TStringlist.Create;
      try
        if DirectoryExists(Path) then
           SL.Savetofile(Path + 'temp.htm')
        else
          showmessage('不存在');
      finally
        SL.free;
      end;
    end;