求JavaScript打开文件代码!!!!!!!!!!!!!!! 数据库中存放一个文件路径比如C:\aaaa.txt.从DB中取出后根据这个路径去打开文件. 首先要判断驱动器存不存在,存在打开文件,不存在弹出信息. 代码怎么写???? 在线等待!!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是的用JavaScript打开.请帮忙!!! //将错误日志写入文件的类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方法就是一个写文本文件的操作 如果搂主想判断驱动器,可以参考下面的语句:fso.GetDrive(fso.GetDriveName("c:\\")); //返回一个Driver对象,如果为空则不存在另外还可以取得文件夹对象:fso.GetFolder("c:\\Folder"); //返回一个Folder对象,如果为空则不存在 java调用ireport4.0生成的.jasper文件的问题。 JAVA NIO中服务器断开socketChannel的状态问题 如何判断一个文件夹下是否有子文件夹? 一个i/o方面的问题 腾迅七周年,送6位QQ免费号 请问一个关于zip压缩的问题 急 JDK 最新版本在那下载,给出具体连接地址. 查找JAVA资源 求SQLServer的JDBC驱动程序 关于StringBuffer的一个小问题,希望解答下! java加载SQL驱动 pdfbox 下载下来怎么用啊?求高人指点
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方法就是一个写文本文件的操作
fso.GetDrive(fso.GetDriveName("c:\\")); //返回一个Driver对象,如果为空则不存在另外还可以取得文件夹对象:
fso.GetFolder("c:\\Folder"); //返回一个Folder对象,如果为空则不存在