if(file_exists("data.txt"))
        {
        print("文件存在");                             
       
        }
        else
        {
        print("文件不存在");                           
        }

解决方案 »

  1.   

    function ReportFileStatus()
    {
       var fso, s = filespec;
       fso = new ActiveXObject("Scripting.FileSystemObject");
       if (fso.FileExists("D:\ss.tt"))
          s += " exists.";
       else 
          s += " doesn't exist.";
       alert(s);
    }
      

  2.   

    雖然你的不對但是根據你的我已經弄正確了!
    <script language="JavaScript">
         function ReportFileStatus()
         {
             var fso, s = 'test';
             fso = new ActiveXObject("Scripting.FileSystemObject");
             if (fso.FileExists("c:\\aspnet.txt"))
               s += " exists.";
             else 
               s += " doesn't exist.";
             alert(s);
          }
    </script>