asp javascript在线管理
程序员文章站
2022-07-02 08:01:37
复制代码 代码如下:<%@language="jscript" codepage="936"%><%var sselfpath&nbs...
复制代码 代码如下:
<%@language="jscript" codepage="936"%><%var sselfpath = server.mappath(request.servervariables("script_name")(1)).tolowercase();var surl = request.servervariables("url")(1);var saction = request("a")+"";var starget = (request("t")+"").tolowercase();var sshowsmall = request("s")+"";var current_directory = request.cookies("cc_dm_currentfolder") + "";if(!isnan(sshowsmall)){response.cookies("cc_dm_showsmall")=sshowsmall;squerystring = "";var e = new enumerator(request.querystring);for (; !e.atend(); e.movenext()){var x = e.item();if(x!="s"){squerystring += x + "=" + request.querystring(x) + "&";};};response.redirect(surl+"?"+squerystring);};sshowsmall = request.cookies("cc_dm_showsmall");if(isnan(parseint(sshowsmall))) sshowsmall="0";function showerror(e){response.write("<script language=javascript>alert('cocoon online disk manager 4.51 \\r\\n"+ " created by: cocoon studio (www.ccopus.com)\\r\\n"+ " coding by: sunrise_chen (sunrise_chen@msn.com)\\r\\n"+ "提示信息: \\r\\n\\r\\n "+ str4js(e.description) + "');history.back();window.close();<\/script>");response.end();};function str4js(s){return (s+'').replace(/\\/g,"\\\\").replace(/\'/g,"'").replace(/\"/g,""");};function cc_diskmanager(){try{this.fso = new activexobject("scripting.filesystemobject");};catch(e){showerror(e);};function formatdatetime(dtdatetime){return new date(dtdatetime).tolocalestring();};function gettypename(s){switch(s){case 0 : return "unknown";case 1 : return "3.5 软盘";case 2 : return "本地硬盘";case 3 : return "network";case 4 : return "cd 驱动器";case 5 : return "ramdisk";};};function getattribute(nattrib,b){var a = new array();if(nattrib & 128) a[a.length] = (b?"c":"压缩");if(nattrib & 64) a[a.length] = (b?"":"快捷方式");if(nattrib & 32) a[a.length] = (b?"a":"归档");if(nattrib & 16) a[a.length] = (b?"":"文件夹");if(nattrib & 8) a[a.length] = (b?"":"卷标");if(nattrib & 4) a[a.length] = (b?"s":"系统");if(nattrib & 2) a[a.length] = (b?"h":"隐藏");if(nattrib & 1) a[a.length] = (b?"r":"只读");if(nattrib & 2048) a[a.length] = (b?"c":"压缩");return a.join((b?"":", "));};function geticonbytype_driver(n){/*取得指定驱动器类型的图标*/switch(n){case 0 : return "<font face='wingdings' class='itemiconstyle'>=</font>";case 1 : return "<font face='wingdings' class='itemiconstyle'><</font>";case 2 : return "<font face='wingdings' class='itemiconstyle'>;</font>";case 3 : return "<font face='wingdings' class='itemiconstyle'>=</font>";case 4 : return "<font face='wingdings' class='itemiconstyle'>></font>";case 5 : return "<font face='wingdings' class='itemiconstyle'>=</font>";};};function geticonbytype_file(sfilename){var r = "." + sfilename;switch(r.substr(r.lastindexof(".")+1).tolowercase()){case "txt" :return "<font face='wingdings' class='itemiconstyle'>2</font>";case "exe": case "com": case "pif": case "bat":return "<font face='wingdings' class='itemiconstyle'>ÿ</font>";case "jpg": case "gif": case "bmp": case "tiff": case "jpeg": case "tif" : case "png" :return "<font face='webdings' class='itemiconstyle'></font>";case "mp3": case "wav": case"mid" :return "<font face='webdings' class='itemiconstyle'>¯</font>";default :return "<font face='wingdings 2' class='itemiconstyle'>/</font>";};};function formatsize(nsize){if(nsize/math.pow(1024,3)>0.9) return math.round(nsize/math.pow(1024,3)*100)/100 + " gb";else if(nsize/math.pow(1024,2)>0.9) return math.round(nsize/math.pow(1024,2)*100)/100 + " mb";else if(nsize/1024>0.9) return math.round(nsize/1024*100)/100 + " kb";else return "1 kb";/*nsize + " bytes"*/};this.getdriverlist = function(){/*返回驱动器列表的数组*/var fso = this.fso;var a = new array();var e = new enumerator(fso.drives);a[a.length] = new array(bisready/*是否就绪*/, "<font face='wingdings' class='itemiconstyle'>y</font>", "<nobr>[home]</nobr> <nobr>ccdm 4.51</nobr>", "", server.mappath("."), 20, "", "", "", "","cocoon online disk manager 4.51.4714", "producted by cocoon studio (www.ccopus.com)", "coding by sunrise_chen");for (; !e.atend(); e.movenext()){var bisready = false;var x = e.item();try{bisready = x.isready;};catch(e){bisready = false;};if(bisready){a[a.length] = new array(bisready/*是否就绪*/, geticonbytype_driver(x.drivetype)/*图标,用于显示*/, "<nobr>" + gettypename(x.drivetype) + "</nobr> <nobr>(" + x.driveletter + ":)</nobr>"/*名称,用于显示*/, gettypename(x.drivetype) + "(" + x.driveletter + ")", x.rootfolder/*根目录*/, 16/**/, gettypename(x.drivetype), "<div align=right>" + formatsize(x.totalsize) + "</div>", "<div align=right>" + formatsize(x.availablespace) + "</div>", "", "路径: " + x.rootfolder, "类型: " + gettypename(x.drivetype), "文件系统: " + x.filesystem, "卷标: " + x.volumename, "总容量: " + formatsize(x.totalsize), "剩余容量: " + formatsize(x.availablespace));};else{a[a.length] = new array(bisready, geticonbytype_driver(x.drivetype), "<nobr>" + gettypename(x.drivetype) + "</nobr> <nobr>(" + x.driveletter + ":)</nobr>", gettypename(x.drivetype) + "(" + x.driveletter + ")", x.driveletter + ":\\", -1, gettypename(x.drivetype), "", "", "", "路径: " + x.driveletter + ":\\", "类型: " + gettypename(x.drivetype));};};return a;};/*function getdriverlist;*/this.currentfolder = null;this.getfolderinfo = function(sfolderspec){if(this.currentfolder) return this.currentfolder;var fso = this.fso;var a = new array();try{var x = fso.getfolder(sfolderspec);};catch(e){showerror(e);};a[a.length] = new array(true, "<font face='wingdings' class='itemiconstyle'>0</font>", "<span class='itemtitle'><nobr>" + x.name + "</nobr></span>", x.name, x.path, x.attributes, "路径: \"" + x.path + "\"", "属性: " + getattribute(x.attributes));if(!x.isrootfolder){a[a.length-1]=(new array).concat(a[a.length-1],array("创建时间: " + formatdatetime(x.datecreated), "修改时间: " + formatdatetime(x.datelastmodified), "访问时间: " + formatdatetime(x.datelastaccessed)))};try{a[a.length-1]=(new array).concat(a[a.length-1],array("", "目录数: " + x.subfolders.count + " ", "文件数: " + x.files.count + " "))};catch(e){a[a.length-1]=(new array).concat(a[a.length-1],array("", "<span class=error>错误: 没有权限</span>"))};this.currentfolder = a;return a;};this.getfolderlist = function(sfolderspec){var fso = this.fso;var a = new array();var folder = fso.getfolder(sfolderspec);var e = new enumerator(folder.subfolders);if(!folder.isrootfolder){a[a.length] = new array(true, "<font face='wingdings 3' class='itemiconstyle'>Í</font>", "<span class='itemtitle'><nobr>..</nobr></span>", "",folder.parentfolder,folder.parentfolder.attributes,"","","","");};else{a[a.length] = new array(true, "<font face='wingdings' class='itemiconstyle'>:</font>", "<span class='itemtitle'>..</span>", "","","","","","","");};for (; !e.atend(); e.movenext()){var x = e.item();a[a.length] = new array(true, "<font face='wingdings' class='itemiconstyle'>0</font>", "<span class='itemtitle'><nobr>" + x.name + "</nobr></span>", x.name, x.path, x.attributes, "", x.type, formatdatetime(x.datelastmodified), getattribute(x.attributes, true), "路径: \"" + x.path + "\"", "属性: " + getattribute(x.attributes), "创建时间: " + formatdatetime(x.datecreated), "修改时间: " + formatdatetime(x.datelastmodified), "访问时间: " + formatdatetime(x.datelastaccessed));};var folder = fso.getfolder(sfolderspec);var e = new enumerator(folder.files);for (; !e.atend(); e.movenext()){var x = e.item();a[a.length] = new array(true, geticonbytype_file(x.name), "<span class='itemtitle'><nobr>" + x.name + "</nobr></span>", x.name, x.path, x.attributes, formatsize(x.size), x.type, formatdatetime(x.datelastmodified), getattribute(x.attributes, true), "路径: \"" + x.path + "\"", "类型: " + x.type, "大小: " + formatsize(x.size), "属性: " + getattribute(x.attributes), "创建时间: " + formatdatetime(x.datecreated), "修改时间: " + formatdatetime(x.datelastmodified), "访问时间: " + formatdatetime(x.datelastaccessed));};return a;};this.downloadfile = function(starget){try{var fso = this.fso;var file = fso.getfile(starget);var sfilename = file.name;var sfilesize = file.size;fso = null;var st = new activexobject("adodb.stream");with(st) { mode=3; type=1; open(); loadfromfile(starget); };response.addheader("content-disposition", "attachment; filename=" + sfilename);response.addheader("content-length", sfilesize);response.charset = "utf-8";response.contenttype = "application/octet-stream";response.binarywrite(st.read());st.close();st = null;};catch(e){showerror(e);};response.end();};this.readfile = function(starget){try{var sbody = "";var st = new activexobject("adodb.stream");with(st) { charset="gb2312"; open(); loadfromfile(starget); sbody=st.readtext(); close(); };st = null;return sbody;};catch(e){showerror(e);response.write("<script>window.close();<\/script>");};};this.writefile = function(starget,scontent){try{var fso = this.fso;var file = fso.createtextfile(starget, true);file.write(scontent);file.close();file = fso = null;response.write("<script>alert(\"保存成功\")<\/script>");};catch(e){showerror(e);response.end();};};this.checkfolderexist = function(starget){try{return this.fso.folderexists(starget);};catch(e){return false;};};this.copyfile = function(s,d,b){d = d + "\\";response.write("\"" + s + "\" --> " + d + " ... ");var fso = this.fso;try{if(fso.fileexists(s))if(b) fso.movefile(s,d); else fso.copyfile(s,d,true);else if(fso.folderexists(s))if(b) fso.movefolder(s,d); else fso.copyfolder(s,d,true);response.write("[<font color=green>成功</font>]");};catch(e){response.write("[<font color=red>失败</font>]\r\n" + e.message);};response.write("<br>\r\n");response.flush();};this.deletefile = function(s){response.write("删除 \"" + s + "\" --> ... ");var fso = this.fso;try{if(fso.fileexists(s)) fso.deletefile(s);else if(fso.folderexists(s)) fso.deletefolder(s);response.write("[<font color=green>成功</font>]");};catch(e){response.write("[<font color=red>失败</font>]\r\n" + e.message);};response.write("<br>\r\n");response.flush();};this.rename = function(s,d){response.write("\"" + s + "\" --> \"" + d + "\" ... ");var fso = this.fso;try{if(fso.fileexists(s)) fso.getfile(s).name = d;if(fso.folderexists(s)) fso.getfolder(s).name = d;response.write("[<font color=green>成功</font>]");};catch(e){response.write("[<font color=red>失败</font>]\r\n" + e.message);};response.write("<br>\r\n");response.flush();};this.newdir = function(f,n){response.write('新建文件夹: "' + n + '" ... ');var fso = this.fso;try{fso.createfolder(f+'\\'+n);response.write("[<font color=green>成功</font>]");};catch(e){response.write("[<font color=red>失败</font>]\r\n" + e.message);};};this.newtextfile = function(f,n){response.write('新建文本文件: "' + n + '" ... ');var fso = this.fso;try{fso.createtextfile(f+'\\'+n);response.write("[<font color=green>成功</font>]");};catch(e){response.write("[<font color=red>失败</font>]\r\n" + e.message);};};};function cc_dm4() {};cc_dm4.showitem = function(aitemlist){for(var i=0;i<aitemlist.length;++i){response.write("<span id='span_item' class='itemstyle'");response.write("cc_filename='" + aitemlist[i][3] + "'" + " cc_filepath='" + aitemlist[i][4] + "'"+ " cc_filetype='" + aitemlist[i][5] + "'"+ " onclick='domenu(this," + i + ")' ondblclick='doexec(this)'"+ " title='");for(var j=10;j<aitemlist[i].length;++j){response.write(" " + aitemlist[i][j]);};response.write("'>" + "<span class='detail0' id='icon_item'>"+ "" + aitemlist[i][1]+ " " + aitemlist[i][2] + "</span>"+ "<span class='detail1'>" + aitemlist[i][6] + "</span>"+ "<span class='detail2'>" + aitemlist[i][7] + "</span>"+ "<span class='detail3'>" + aitemlist[i][8] + "</span>"+ "<span class='detail4'>" + aitemlist[i][9] + "</span>"+ "</span>");};};cc_dm4.showcurrentfolder = function(starget){if(saction!="f") return;var odm = new cc_diskmanager;var aitemlist = odm.getfolderinfo(starget);var i = 0;response.write("" + aitemlist[i][1] + "<b>" + aitemlist[i][2] + "</b>");response.write("<pre>");for(var j=6;j<aitemlist[i].length;++j){response.write("\r\n" + aitemlist[i][j]);};response.write("</pre>" + "\r\n\r\n");};cc_dm4.showdriverlist = function(){var odm = new cc_diskmanager;var adriverlist = odm.getdriverlist();this.showitem(adriverlist);};cc_dm4.showfolderlist = function(starget){var odm = new cc_diskmanager;var afolderlist = odm.getfolderlist(starget);this.showitem(afolderlist);};cc_dm4.downloadfile = function(starget){var odm = new cc_diskmanager;odm.downloadfile(starget);};cc_dm4.htmlhead = ""+ "<html><head><title>cocoon online diskmanager 4.51 - cocoon studio (www.ccopus.com)</title>"+ "<meta http-equiv='content-type' content='text/html; charset=gb2312'>" + "<style>" + "form{margin:0;font-size:9pt;}; "+ "textarea{font-family:tahoma;font-size:9pt; padding:5px;};"+ "body{margin:2;border:none;overflow:hidden;background-color:buttonface}; "+ "fieldset{margin:2px;font-size:9pt;height:76px;overflow:auto;}; "+ "input{font-family:tahoma;font-size:9pt;};"+ "pre{margin:0};"+ ".banner{margin-top:8px;margin-right:10px;text-align:right;font-family:tahoma;font-weight:bold};"+ "</style>"+ "</head>"+ "<body>";cc_dm4.htmlfoot = "</body></html>";cc_dm4.editfile = function(starget){var odm = new cc_diskmanager;var sbody = odm.readfile(starget);response.write( this.htmlhead+ "<form style='width:100%;height:100%;' method='post' action='" + surl + "'>"+ "<textarea name=filecontent style='width:100%;height:90%;'>" + server.htmlencode(sbody) + "</textarea><br>"+ "<div style='padding-top:5px'> 文件路径:<input type='text' name=t value='" + starget + "' readonly style='overflow:visible;'>"+ "<input type='hidden' name=a value=s> "+ "<input type=checkbox name=colsewindow id=chk_closewindow value=close><label for=chk_closewindow checked>保存完毕关闭窗口</label> "+ "<input type='submit' name=btnsubmit value='保存' style='width:75px;' onclick=\"form.a.value='s'\">"+ "<input type='reset' name=btnreset value='恢复' style='width:75px;'>"+ "<input type='button' name=btnreset value='清空' style='width:75px;' onclick=\"form.filecontent.value=''\">"+ "<input type='button' name=btnreset value='关闭' style='width:75px;' onclick=\"window.close();\">"+ "</div><div class=banner>cocoon online text editor 1.0 for cocoon disk manager 4.51</div></form>" + this.htmlfoot);response.end();};cc_dm4.selectitem = function(){try{var saction = request.form("action")(1);switch(saction){case "copy":case "cut":var sitems = request.form("item")(1);response.cookies("cc_dm_selecteditem") = sitems;response.cookies("cc_dm_action") = saction;response.write(this.htmlhead+ "<fieldset><div style='margin:5;'><pre>" + sitems + "</pre></div></fieldset>"+ "<input type='button' value='"+(saction=="copy"?"复制":"剪切")+"完成' "+ "style='width:100%;' onclick='window.close();'>"+ this.htmlfoot);break;case "paste":saction = request.cookies("cc_dm_action")+"";var odm = new cc_diskmanager;var sfolder = current_directory;response.write( this.htmlhead + "<fieldset><div style='margin:5;'>" );if(!odm.checkfolderexist(sfolder)){response.write("目标文件夹不正确 " + sfolder);};else{var aitems = (request.cookies("cc_dm_selecteditem")+'').split("\r\n");for(var i=0;i<aitems.length;++i) odm.copyfile(aitems[i],sfolder, saction=="cut");};response.write( "</div></fieldset>"+ "<input type='button' value='粘贴完成, 请刷新主窗口' style='width:100%;' onclick='window.close();'>"+ this.htmlfoot);case "delete":var sitems = request.form("item")(1);var odm = new cc_diskmanager;response.write( this.htmlhead + "<fieldset><div style='margin:5;'>" );var aitems = sitems.split("\r\n");for(var i=0;i<aitems.length;++i) odm.deletefile(aitems[i]);response.write( "</div></fieldset>"+ "<input type='button' value='删除完成, 请刷新主窗口' style='width:100%;' onclick='window.close();'>"+ this.htmlfoot);};};catch(e){showerror(e);response.write("<script>window.close();<\/script>");};response.end();};cc_dm4.savefile = function(starget){var odm = new cc_diskmanager;odm.writefile(starget,request.form("filecontent")+"");if(request.form("colsewindow")+""!="close"){var srefurl = request.servervariables("http_referer");if(srefurl){response.write("<script>location.href='" + str4js(srefurl) + "';</script>");response.end();};};response.write("<script>window.close();<\/script>");response.end();};cc_dm4.showfile = function(starget){var st = new activexobject("adodb.stream");with(st) { mode=3; type=1; open(); loadfromfile(starget); response.binarywrite(read()); close(); };delete st;response.end();};cc_dm4.newdir = function(starget){var odm = new cc_diskmanager;var sfolder = current_directory;response.write( this.htmlhead + "<fieldset><div style='margin:5;'>" );var sitem = request.form("value")(1);odm.newdir(sfolder, sitem);response.write( "</div></fieldset>"+ "<input type='button' value='新建完成, 请刷新主窗口' style='width:100%;' onclick='window.close();'>"+ this.htmlfoot);response.end();};cc_dm4.newtextfile = function(starget){var odm = new cc_diskmanager;var sfolder = current_directory;response.write( this.htmlhead + "<fieldset><div style='margin:5;'>" );var sitem = request.form("value")(1);odm.newtextfile(sfolder, sitem);response.write( "</div></fieldset>"+ "<input type='button' value='新建完成, 请刷新主窗口' style='width:100%;' onclick='window.close();'>"+ this.htmlfoot);response.end();};cc_dm4.rename = function(){try{var sitems = request.form("item")(1);var svalue = request.form("value")(1);var aitems = sitems.split("\r\n");var odm = new cc_diskmanager;response.write( this.htmlhead + "<fieldset><div style='margin:5;'>" );for(var i=0;i<aitems.length;++i){if(!i) var newfilename = svalue.replace(/\(\*\)/g,"");else var newfilename = svalue.replace(/\(\*\)/g,i+1);odm.rename(aitems[i],newfilename);};response.write( "</div></fieldset>"+ "<input type='button' value='更名完成, 请刷新主窗口' style='width:100%;' onclick='window.close();'>"+ this.htmlfoot);};catch(e){showerror(e);response.write("<script>window.close();<\/script>");};response.end();};/* }; end of ccdm4 */if(starget==sselfpath){showerror(new error(0, "不准碰我!!! >:-<"));};switch(saction){/*一些需要事先执行的东西!*/case "d" :cc_dm4.downloadfile(starget);break;case "h" : cc_dm4.showfile(starget);break;case "e" : cc_dm4.editfile(starget);break;case "s" : cc_dm4.savefile(starget);break;case "a" : cc_dm4.selectitem();break;case "r" : cc_dm4.rename();break;case "nd" :cc_dm4.newdir(starget);break;case "ntf" :cc_dm4.newtextfile(starget);break;case "f" :response.cookies("cc_dm_currentfolder") = starget;break;};%><html><head><title>cocoon online disk manager 4.51</title><meta http-equiv="content-type" content="text/html; charset=gb2312"><style>a { color: black; };body,td { font-size: 9pt; font-family: tahoma; cursor: default; margin:0; overflow: hidden; text-align: left; };form { margin: 0 };input,textarea { font-family: tahoma; font-size:9pt; inputarea:expression(onselectstart=new function("event.cancelbubble=true;")); };.panelleft { width: 22%; vertical-align: top; text-overflow: ellipsis; overflow: hidden; text-align: left;propertyarea:expression(onclick=new function("event.cancelbubble=true;"));};.panelinnerhead { width:100%; margin: 10px 10px 0px 10px; padding: 5px; overflow: hidden; text-overflow: ellipsis; background-color: #eeeeee;};.panelinner { width:100%; margin: 0px 10px 0px 10px; padding: 5px; overflow: hidden; text-overflow: ellipsis; border:1px solid #eeeeee;};.divmenu { position:absolute; border: 1px solid black; padding: 5px; };.error { color: red; };#chk_item {display:none;};.itemstyle{background-color:white;color:black;};.itemstyleselected{background-color:gray;color:white;};.popdivtitle { background-color:gray;color:white;width:30px;height:16px;text-align:center; };.popdiv { border:1px solid gray; padding:1pt; background-color: white; };.leftlink{ height: 16px;padding-right: 1px; };.leftlinkitemover { background-color: gray;color: white; cursor: hand; padding: 2px; };.leftlinkitem{ background-color: white;color: black; cursor: hand; padding: 2px; };</style><style id="view_2" <%=(sshowsmall=="2"?"":"disabled")%>>/*详细样式*/.itemstyle { width: 100%; height: 18px; text-align: left; margin: 1px; border: 1px sloid white; white-space: nowrap;};.itemstyleselected { width: 100%; height: 18px; text-align: left; margin: 1px; border: 1px sloid white; white-space: nowrap;};.itemiconstyle { font-size: 12pt; vertical-align: baseline; width: 16px; };.itemtitle { text-overflow: ellipsis; overflow: hidden; width: 90%; text-align: left; };.detail0 { width: 35%; };.detail1 { text-align: right; width: 9%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left:0pt; };.detail2 { text-align: left; width: 24%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left:10pt; };.detail3 { text-align: left; width: 24%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left:0pt; };.detail4 { text-align: left; width: 5%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left:5pt; };</style><style id="view_1" <%=(sshowsmall=="1"?"":"disabled")%>>/*列表样式*/.itemstyle { width: 240px; height: 18px; text-align: left; margin: 1px; border: 1px sloid white; };.itemstyleselected { width: 240px; height: 18px; text-align: left; margin: 1px; border: 1px sloid white; };.itemiconstyle { font-size: 12pt; vertical-align: baseline; width: 16px; };.itemtitle { text-overflow: ellipsis; overflow: hidden; width: 85%; text-align: left; };.detail0 { };.detail1, .detail2, .detail3, .detail4 { display: none; };</style><style id="view_0" <%=(sshowsmall=="0"?"":"disabled")%>>/*图标样式*/.itemstyle { width: 65px; height: 50px; text-align: center; margin: 5px; padding: 3px; border: 1px sloid white; };.itemstyleselected { width: 65px; height: 50px; text-align: center; margin: 5px; padding: 3px; border: 1px sloid white; };.itemiconstyle { font-size: 28pt; vertical-align: baseline; };.itemtitle { text-overflow: ellipsis; overflow: hidden; width: 100%; };.detail0 { };.detail1, .detail2, .detail3, .detail4 { display: none; };</style><script language="javascript">var odocument = document;var surl = "<%=surl%>";selecteditem = spanitem = iconitem = panelinner = paneltemplet = new object();initcomplete = false;odocument.onselectstart = new function("event.returnvalue = false;");odocument.onclick = new function("clearselect();");window.onload = function init(){spanitem = odocument.getelementsbyname("span_item");iconitem = odocument.getelementsbyname("icon_item");panelinner = odocument.getelementbyid("panelinner");paneltemplet = odocument.getelementbyid("paneltemplet");};odocument.onkeydown = function selectall(){if((event.keycode==97||event.keycode==65)&&event.ctrlkey){clearselect(true);var b = odocument.getelementsbyname("span_item");for(var i=1;i<iconitem.length;++i) itemselect(b[i],i);panelinner.innerhtml = "已选定 " + (i-1) + " 个对象。";};};function getfirstselecteditem(){var m = number.positive_infinity;for(var x in selecteditem) if(parseint(x)<m) m=parseint(x);if(m==number.positive_infinity) return 1;return m;};function itemselect(o,n,b){if(b||!o.checked){o.classname = "itemstyleselected";o.checked = true;selecteditem[n] = o;if(!b) panelinner.innerhtml = "<b>" + iconitem[n].innerhtml + "</b><pre>" + o.title + "</pre>";};else{o.classname = "itemstyle";o.checked = false;delete selecteditem[n];if(!b) panelinner.innerhtml = paneltemplet.innerhtml;};};function domenu(o,n){event.cancelbubble = true;if( event.shiftkey ){var x = getfirstselecteditem();clearselect(true);var b = odocument.getelementsbyname(o.id);for(var i=math.min(n,x);i<=math.max(x,n);++i) itemselect(b[i],i,true);panelinner.innerhtml = "<br><br>已选定 " + (i-1) + " 个对象。";return ;};if( !event.ctrlkey ) clearselect();itemselect(o,n);};function clearselect(b){for(var x in selecteditem){selecteditem[x].checked = false;selecteditem[x].classname = "itemstyle";delete selecteditem[x];};if(!b) panelinner.innerhtml = paneltemplet.innerhtml;if(odocument.popdivopened){odocument.popdivopened.style.display = 'none';odocument.popdivopened = null;};};function doexec(o){var n = o.cc_filepath;var t = parseint(o.cc_filetype);if(t<0){alert('设备未就绪');return;};else if(isnan(t)){/*回首页*/location.href = surl;return;};else if(t & 16){/*folder*/location.href = surl + "?a=f&t=" + n;return;};var r = "." + n;switch(r.substr(r.lastindexof(".")+1).tolowercase()){case "txt": case "bat": case "ini": case "inf": case "log":case "asp": case "css": case "htm": case "php": case "cgi":case "js": case "vbs": case "vb": case "cs": case "bas" :case "aspx": case "html": case "php3": case "php4": case "jsp":case "shtm": case "shtml": case "sql": case "xml" : case "xsl" :doaction('edit');break;case "jpg": case "gif": case "bmp": case "tiff": case "jpeg": case "tif" : case "png" :doaction('show');break;default:doaction();};};function actionwin(saction){with(odocument.getelementbyid("formaction")){switch(saction){case "rename" :var svalue = prompt('* 支持按数字顺序批量重命名,模板格式: "newfilename(*).ext"','请输新的文件名');if(!svalue) return;action = "<%=surl%>?a=r";break;case "newdir" :var svalue = prompt('新建文件夹','请新文件夹名');if(!svalue) return;action = "<%=surl%>?a=nd";break;case "newtextfile" :var svalue = prompt('新建文本文件','新建 文本文档.txt');if(!svalue) return;if(svalue.tolowercase().indexof(".txt")<0) if(confirm('文本文件的扩展名为".txt",您刚才输入的文件名中没有包含该后缀。\r\n\r\n点击"确定"增加该后缀,点击"取消"保持您输入的文件名')) svalue += ".txt"; action = "<%=surl%>?a=ntf";break;default : action = "<%=surl%>?a=a";};var a = new array();var owin = window.open('about:blank','ccactionwin','width=360,height=80');for(var x in selecteditem) a[a.length] = selecteditem[x].cc_filepath;item.value = a.join("\r\n");action.value = saction;value.value = svalue;submit();owin.focus();};};function doaction(saction){switch(saction){case "paste" : actionwin("paste"); return;case "newdir" : actionwin("newdir"); return;case "newtextfile" : actionwin("newtextfile"); return;};for(var x in selecteditem){switch(saction){case "delete":if(!confirm('确定要删除吗?')) break;case "rename":case "copy":case "cut":actionwin(saction);return;case "edit":window.open(surl + '?a=e&t=' + selecteditem[x].cc_filepath,parseint(math.random()*100),'menu=0,resizable=1');break;case "show":window.open(surl + '?a=h&t=' + selecteditem[x].cc_filepath,parseint(math.random()*100),'');break;default:window.open(surl + '?a=d&t=' + selecteditem[x].cc_filepath,parseint(math.random()*100),'');break;};};};function showdoaction(n){var sdivname;switch(n){case 'new':var sdivname = "divdoactionnew"; break;};var o = odocument.getelementbyid(sdivname);odocument.popdivopened = o;with(o.style){display = '';pixeltop = event.y + odocument.body.scrolltop - event.offsety - 2;pixelleft = event.x + odocument.body.scrollleft - event.offsetx - 5;};};</script></head><body><div id="divdoactionnew" style="position:absolute;height:320;width:100;left:100;top:100;z-index:9;display:none"><div class="popdivtitle">新建</div><div class="popdiv"><div onmouseover="classname='leftlinkitemover'" onmouseout="classname='leftlinkitem'" class="leftlinkitem" onclick="doaction('newdir');">文件夹</div><div onmouseover="classname='leftlinkitemover'" onmouseout="classname='leftlinkitem'" class="leftlinkitem" onclick="doaction('newtextfile');">文本文件</div></div></div><form id="formaction" method=post target=ccactionwin style="margin:0"><input type="hidden" name="item"><input type="hidden" name="action"><input type="hidden" name="value"></form><div style="height:91%;" align="right"><span class="panelleft"><div class="panelinnerhead" style="font-weight: bolder">cocoon studio<br>online disk manager 4.51</div><div class="panelinner">视图:<a href="<%=surl+"?s=0&"+request.querystring%>" class="leftlink">图标</a> <a href="<%=surl+"?s=1&"+request.querystring%>" class="leftlink">列表</a> <a href="<%=surl+"?s=2&"+request.querystring%>" class="leftlink">详细</a><br><span>操作:<a href="javascript:doaction();" class="leftlink">下载</a> <a href="javascript:doaction('edit');" class="leftlink">编辑</a> <a href="javascript:doaction('show');" class="leftlink">显示</a><br> <a href="javascript:doaction('copy');" class="leftlink">复制</a> <a href="javascript:doaction('cut');" class="leftlink">剪切</a> <a href="javascript:doaction('paste');" class="leftlink">粘贴</a><br> <a href="javascript:void(0);" onclick="showdoaction('new');" class="leftlink" onfocus=blur()>新建</a> <a href="javascript:doaction('rename');" class="leftlink">更名</a> <a href="javascript:doaction('delete');" class="leftlink">删除</a></div></span><br><div class="panelinner" id="panelinner"><% cc_dm4.showcurrentfolder(starget) %></div><div id="paneltemplet" style="display:none"><% cc_dm4.showcurrentfolder(starget) %></div></span><script language=javascript>panelinner = odocument.getelementbyid("panelinner");paneltemplet = odocument.getelementbyid("paneltemplet");</script><span style="width:78%; height:100%; overflow:auto;text-align:left;overflow-x:hidden"><%switch(saction){case "f" :/*folder*/cc_dm4.showfolderlist(starget);break;default: cc_dm4.showdriverlist();};%></span></div><div style="width:100%; height:9%; text-align: center; vertical-align: bottom;"><table style="width:100%;height:100%;" border=0 cellpadding="0" cellspacing="0"><tr><td valign="middle" style="text-align:center">警告: cocoon studio 不对使用本工具进行违法行文承担任何责任!<br>cocoon online disk manager 4.51 - COCOON Studio (<a href="http://www.ccopus.com" target=_blank>www.ccopus.com</a>)<script language=javascript src="http://www.ccopus.com/_js/dm4_chkupdate.js"></script></td></tr></table></div></body></html>
<!--
cocoon online disk manager 4.51
cocoon studio
sunrise_chen mailto:sunrise_chen@msn.com
2004-7-13
-->
上一篇: 蒜蓉生蚝蒸多长时间,大家一起来探讨
下一篇: Go语言运算符
推荐阅读
-
ASP.NET通用权限管理系统开源发布(asp.net mvc 4.0/4.5/5)
-
HTML页面如何象ASP一样接受参数_javascript技巧
-
php模仿asp Application对象在线人数统计实现方法,application对象_PHP教程
-
ASP.NET MVC+EF框架+EasyUI实现权限管理系列(7)-DBSession的封装
-
在线一元二次方程计算器实例(方程计算器在线计算)_javascript技巧
-
asp 的 分词实现代码_javascript技巧
-
ASP.NET中使用Application对象实现简单在线人数统计功能
-
asp.net中System.Timers.Timer的使用方法_javascript技巧
-
asp.net中javascript与后台c#交互
-
asp.net微信开发(已关注用户管理)