数据库中存放一个文件路径比如C:\aaaa.txt.从DB中取出后根据这个路径去打开文件.
    首先要判断驱动器存不存在,存在打开文件,不存在弹出信息.
    代码怎么写????
    在线等待!!!!

解决方案 »

  1.   

    是的用JavaScript打开.请帮忙!!!
      

  2.   

    //将错误日志写入文件的类
    function ExceptionHelper(info){
    var fileName="\\ExceptionLog.txt";
    var fso=new ActiveXObject("Scripting.FileSystemObject");
    var exceptionInfo= (info == null ? "undefined" : info); this.setFileName=function (file) {
    fileName=file;
    } this.getFileName=function () {
    return fileName;
    } this.setExceptionInfo=function (info){
    exceptionInfo=info;
    } this.getExceptionInfo=function () {
    return exceptionInfo;
    } this.writeExceptionLog=function (info){
    var exceptionFile=fso.CreateTextFile(fileName,true); exceptionFile.WriteLine(info); exceptionFile.Close();
    }
    }
    这个是我原来的代码,writeExceptionLog方法就是一个写文本文件的操作
      

  3.   

    如果搂主想判断驱动器,可以参考下面的语句:
    fso.GetDrive(fso.GetDriveName("c:\\"));      //返回一个Driver对象,如果为空则不存在另外还可以取得文件夹对象:
    fso.GetFolder("c:\\Folder");                 //返回一个Folder对象,如果为空则不存在