手机
当前位置:查字典教程网 >编程开发 >ASP教程 >asp javascript在线管理
asp javascript在线管理
摘要:复制代码代码如下:

复制代码 代码如下:

<%@LANGUAGE="JScript"CODEPAGE="936"%><%varsSelfPath=Server.MapPath(Request.ServerVariables("SCRIPT_NAME")(1)).toLowerCase();varsUrl=Request.ServerVariables("URL")(1);varsAction=Request("a")+"";varsTarget=(Request("t")+"").toLowerCase();varsShowSmall=Request("s")+"";varCURRENT_DIRECTORY=Request.Cookies("Cc_Dm_CurrentFolder")+"";if(!isNaN(sShowSmall)){Response.Cookies("CC_Dm_ShowSmall")=sShowSmall;sQueryString="";vare=newEnumerator(Request.QueryString);for(;!e.atEnd();e.moveNext()){varx=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";functionShowError(e){Response.write("<scriptlanguage=javascript>alert('COCOONOnlineDiskManager4.51rn"+"Createdby:COCOONStudio(www.ccopus.com)rn"+"Codingby:Sunrise_Chen(sunrise_chen@msn.com)rn"+"提示信息:rnrn"+Str4Js(e.description)+"');history.back();window.close();</script>");Response.end();};functionStr4Js(s){return(s+'').replace(//g,"").replace(/'/g,""/g,""");};functionCc_DiskManager(){try{this.fso=newActiveXObject("Scripting.FileSystemObject");};catch(e){ShowError(e);};functionFormatDateTime(dtDateTime){returnnewDate(dtDateTime).toLocaleString();};functionGetTypeName(s){switch(s){case0:return"Unknown";case1:return"3.5软盘";case2:return"本地硬盘";case3:return"Network";case4:return"CD驱动器";case5:return"RamDisk";};};functionGetAttribute(nAttrib,b){vara=newArray();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":"压缩");returna.join((b?"":","));};functionGetIconByType_Driver(n){/*取得指定驱动器类型的图标*/switch(n){case0:return"<fontface='wingdings'class='ItemIconStyle'>";case1:return"<fontface='wingdings'class='ItemIconStyle'>";case2:return"<fontface='wingdings'class='ItemIconStyle'>";case3:return"<fontface='wingdings'class='ItemIconStyle'>";case4:return"<fontface='wingdings'class='ItemIconStyle'>";case5:return"<fontface='wingdings'class='ItemIconStyle'>";};};functionGetIconByType_File(sFileName){varr="."+sFileName;switch(r.substr(r.lastIndexOf(".")+1).toLowerCase()){case"txt":return"<fontface='wingdings'class='ItemIconStyle'>";case"exe":case"com":case"pif":case"bat":return"<fontface='wingdings'class='ItemIconStyle'>";case"jpg":case"gif":case"bmp":case"tiff":case"jpeg":case"tif":case"png":return"<fontface='webdings'class='ItemIconStyle'>";case"mp3":case"wav":case"mid":return"<fontface='webdings'class='ItemIconStyle'>";default:return"<fontface='wingdings2'class='ItemIconStyle'>";};};functionFormatSize(nSize){if(nSize/Math.pow(1024,3)>0.9)returnMath.round(nSize/Math.pow(1024,3)*100)/100+"GB";elseif(nSize/Math.pow(1024,2)>0.9)returnMath.round(nSize/Math.pow(1024,2)*100)/100+"MB";elseif(nSize/1024>0.9)returnMath.round(nSize/1024*100)/100+"KB";elsereturn"1KB";/*nSize+"Bytes"*/};this.GetDriverList=function(){/*返回驱动器列表的数组*/varfso=this.fso;vara=newArray();vare=newEnumerator(fso.Drives);a[a.length]=newArray(bIsReady/*是否就绪*/,"<fontface='wingdings'class='ItemIconStyle'>","<nobr>[Home]</nobr><nobr>CCDM4.51</nobr>","",Server.MapPath("."),20,"","","","","COCOONOnlineDiskManager4.51.4714","ProductedbyCocoonStudio(www.ccopus.com)","CodingbySunrise_Chen");for(;!e.atEnd();e.moveNext()){varbIsReady=false;varx=e.item();try{bIsReady=x.isReady;};catch(e){bIsReady=false;};if(bIsReady){a[a.length]=newArray(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),"<divalign=right>"+FormatSize(x.TotalSize)+"</div>","<divalign=right>"+FormatSize(x.AvailableSpace)+"</div>","","路径:"+x.RootFolder,"类型:"+GetTypeName(x.DriveType),"文件系统:"+x.FileSystem,"卷标:"+x.VolumeName,"总容量:"+FormatSize(x.TotalSize),"剩余容量:"+FormatSize(x.AvailableSpace));};else{a[a.length]=newArray(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));};};returna;};/*functionGetDriverList;*/this.CurrentFolder=null;this.GetFolderInfo=function(sFolderSpec){if(this.CurrentFolder)returnthis.CurrentFolder;varfso=this.fso;vara=newArray();try{varx=fso.GetFolder(sFolderSpec);};catch(e){ShowError(e);};a[a.length]=newArray(true,"<fontface='wingdings'class='ItemIconStyle'>","<spanclass='ItemTitle'><nobr>"+x.name+"</nobr></span>",x.Name,x.Path,x.Attributes,"路径:""+x.Path+""","属性:"+GetAttribute(x.Attributes));if(!x.isRootFolder){a[a.length-1]=(newArray).concat(a[a.length-1],Array("创建时间:"+FormatDateTime(x.DateCreated),"修改时间:"+FormatDateTime(x.DateLastModified),"访问时间:"+FormatDateTime(x.DateLastAccessed)))};try{a[a.length-1]=(newArray).concat(a[a.length-1],Array("","目录数:"+x.subfolders.count+"","文件数:"+x.files.count+""))};catch(e){a[a.length-1]=(newArray).concat(a[a.length-1],Array("","<spanclass=error>错误:没有权限</span>"))};this.CurrentFolder=a;returna;};this.GetFolderList=function(sFolderSpec){varfso=this.fso;vara=newArray();varfolder=fso.GetFolder(sFolderSpec);vare=newEnumerator(folder.SubFolders);if(!folder.isRootFolder){a[a.length]=newArray(true,"<fontface='wingdings3'class='ItemIconStyle'>","<spanclass='ItemTitle'><nobr>..</nobr></span>","",folder.ParentFolder,folder.ParentFolder.attributes,"","","","");};else{a[a.length]=newArray(true,"<fontface='wingdings'class='ItemIconStyle'>","<spanclass='ItemTitle'>..</span>","","","","","","","");};for(;!e.atEnd();e.moveNext()){varx=e.item();a[a.length]=newArray(true,"<fontface='wingdings'class='ItemIconStyle'>","<spanclass='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));};varfolder=fso.GetFolder(sFolderSpec);vare=newEnumerator(folder.Files);for(;!e.atEnd();e.moveNext()){varx=e.item();a[a.length]=newArray(true,GetIconByType_File(x.name),"<spanclass='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));};returna;};this.DownloadFile=function(sTarget){try{varfso=this.fso;varfile=fso.GetFile(sTarget);varsFileName=file.name;varsFileSize=file.size;fso=null;varst=newActiveXObject("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{varsBody="";varst=newActiveXObject("ADODB.Stream");with(st){charset="gb2312";open();loadFromFile(sTarget);sBody=st.readText();close();};st=null;returnsBody;};catch(e){ShowError(e);Response.write("<script>window.close();</script>");};};this.WriteFile=function(sTarget,sContent){try{varfso=this.fso;varfile=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{returnthis.fso.FolderExists(sTarget);};catch(e){returnfalse;};};this.CopyFile=function(s,d,b){d=d+"";Response.write("""+s+""-->"+d+"...");varfso=this.fso;try{if(fso.FileExists(s))if(b)fso.MoveFile(s,d);elsefso.CopyFile(s,d,true);elseif(fso.FolderExists(s))if(b)fso.MoveFolder(s,d);elsefso.CopyFolder(s,d,true);Response.write("[<fontcolor=green>成功</font>]");};catch(e){Response.write("[<fontcolor=red>失败</font>]rn"+e.message);};Response.write("<br>rn");Response.Flush();};this.DeleteFile=function(s){Response.write("删除""+s+""-->...");varfso=this.fso;try{if(fso.FileExists(s))fso.DeleteFile(s);elseif(fso.FolderExists(s))fso.DeleteFolder(s);Response.write("[<fontcolor=green>成功</font>]");};catch(e){Response.write("[<fontcolor=red>失败</font>]rn"+e.message);};Response.write("<br>rn");Response.Flush();};this.Rename=function(s,d){Response.write("""+s+""-->""+d+""...");varfso=this.fso;try{if(fso.FileExists(s))fso.GetFile(s).Name=d;if(fso.FolderExists(s))fso.GetFolder(s).Name=d;Response.write("[<fontcolor=green>成功</font>]");};catch(e){Response.write("[<fontcolor=red>失败</font>]rn"+e.message);};Response.write("<br>rn");Response.Flush();};this.NewDir=function(f,n){Response.write('新建文件夹:"'+n+'"...');varfso=this.fso;try{fso.CreateFolder(f+''+n);Response.write("[<fontcolor=green>成功</font>]");};catch(e){Response.write("[<fontcolor=red>失败</font>]rn"+e.message);};};this.NewTextFile=function(f,n){Response.write('新建文本文件:"'+n+'"...');varfso=this.fso;try{fso.CreateTextFile(f+''+n);Response.write("[<fontcolor=green>成功</font>]");};catch(e){Response.write("[<fontcolor=red>失败</font>]rn"+e.message);};};};functionCc_Dm4(){};Cc_Dm4.ShowItem=function(aItemList){for(vari=0;i<aItemList.length;++i){Response.Write("<spanid='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(varj=10;j<aItemList[i].length;++j){Response.Write(""+aItemList[i][j]);};Response.Write("'>"+"<spanclass='detail0'id='icon_item'>"+""+aItemList[i][1]+""+aItemList[i][2]+"</span>"+"<spanclass='detail1'>"+aItemList[i][6]+"</span>"+"<spanclass='detail2'>"+aItemList[i][7]+"</span>"+"<spanclass='detail3'>"+aItemList[i][8]+"</span>"+"<spanclass='detail4'>"+aItemList[i][9]+"</span>"+"</span>");};};Cc_Dm4.ShowCurrentFolder=function(sTarget){if(sAction!="f")return;varoDm=newCc_DiskManager;varaItemList=oDm.GetFolderInfo(sTarget);vari=0;Response.write(""+aItemList[i][1]+"<b>"+aItemList[i][2]+"</b>");Response.Write("<pre>");for(varj=6;j<aItemList[i].length;++j){Response.Write("rn"+aItemList[i][j]);};Response.Write("</pre>"+"rnrn");};Cc_Dm4.ShowDriverList=function(){varoDm=newCc_DiskManager;varaDriverList=oDm.GetDriverList();this.ShowItem(aDriverList);};Cc_Dm4.ShowFolderList=function(sTarget){varoDm=newCc_DiskManager;varaFolderList=oDm.GetFolderList(sTarget);this.ShowItem(aFolderList);};Cc_Dm4.DownloadFile=function(sTarget){varoDm=newCc_DiskManager;oDm.DownloadFile(sTarget);};Cc_Dm4.HtmlHead=""+"<html><head><title>COCOONOnlineDiskManager4.51-CocoonStudio(www.ccopus.com)</title>"+"<metahttp-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){varoDm=newCc_DiskManager;varsBody=oDm.ReadFile(sTarget);Response.write(this.HtmlHead+"<formstyle='width:100%;height:100%;'method='post'action='"+sUrl+"'>"+"<textareaname=fileContentstyle='width:100%;height:90%;'>"+Server.HTMLEncode(sBody)+"</textarea><br>"+"<divstyle='padding-top:5px'>文件路径:<inputtype='text'name=tvalue='"+sTarget+"'readonlystyle='overflow:visible;'>"+"<inputtype='hidden'name=avalue=s>"+"<inputtype=checkboxname=ColseWindowid=chk_closewindowvalue=close><labelfor=chk_closewindowchecked>保存完毕关闭窗口</label>"+"<inputtype='submit'name=btnSubmitvalue='保存'style='width:75px;'onclick="form.a.value='s'">"+"<inputtype='reset'name=btnResetvalue='恢复'style='width:75px;'>"+"<inputtype='button'name=btnResetvalue='清空'style='width:75px;'onclick="form.fileContent.value=''">"+"<inputtype='button'name=btnResetvalue='关闭'style='width:75px;'onclick="window.close();">"+"</div><divclass=banner>COCOONOnlineTextEditor1.0forCocoonDiskManager4.51</div></form>"+this.HtmlFoot);Response.End();};Cc_Dm4.SelectItem=function(){try{varsAction=Request.Form("Action")(1);switch(sAction){case"copy":case"cut":varsItems=Request.Form("Item")(1);Response.Cookies("Cc_Dm_SelectedItem")=sItems;Response.Cookies("Cc_Dm_Action")=sAction;Response.write(this.HtmlHead+"<fieldset><divstyle='margin:5;'><pre>"+sItems+"</pre></div></fieldset>"+"<inputtype='button'value='"+(sAction=="copy"?"复制":"剪切")+"完成'"+"style='width:100%;'onclick='window.close();'>"+this.HtmlFoot);break;case"paste":sAction=Request.Cookies("Cc_Dm_Action")+"";varoDm=newCc_DiskManager;varsFolder=CURRENT_DIRECTORY;Response.write(this.HtmlHead+"<fieldset><divstyle='margin:5;'>");if(!oDm.CheckFolderExist(sFolder)){Response.write("目标文件夹不正确"+sFolder);};else{varaItems=(Request.Cookies("Cc_Dm_SelectedItem")+'').split("rn");for(vari=0;i<aItems.length;++i)oDm.CopyFile(aItems[i],sFolder,sAction=="cut");};Response.write("</div></fieldset>"+"<inputtype='button'value='粘贴完成,请刷新主窗口'style='width:100%;'onclick='window.close();'>"+this.HtmlFoot);case"delete":varsItems=Request.Form("Item")(1);varoDm=newCc_DiskManager;Response.write(this.HtmlHead+"<fieldset><divstyle='margin:5;'>");varaItems=sItems.split("rn");for(vari=0;i<aItems.length;++i)oDm.DeleteFile(aItems[i]);Response.write("</div></fieldset>"+"<inputtype='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){varoDm=newCc_DiskManager;oDm.WriteFile(sTarget,Request.Form("fileContent")+"");if(Request.Form("colsewindow")+""!="close"){varsRefUrl=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){varst=newActiveXObject("ADODB.Stream");with(st){mode=3;type=1;open();loadFromFile(sTarget);Response.binaryWrite(read());close();};deletest;Response.end();};Cc_Dm4.NewDir=function(sTarget){varoDm=newCc_DiskManager;varsFolder=CURRENT_DIRECTORY;Response.write(this.HtmlHead+"<fieldset><divstyle='margin:5;'>");varsItem=Request.Form("value")(1);oDm.NewDir(sFolder,sItem);Response.write("</div></fieldset>"+"<inputtype='button'value='新建完成,请刷新主窗口'style='width:100%;'onclick='window.close();'>"+this.HtmlFoot);Response.end();};Cc_Dm4.NewTextFile=function(sTarget){varoDm=newCc_DiskManager;varsFolder=CURRENT_DIRECTORY;Response.write(this.HtmlHead+"<fieldset><divstyle='margin:5;'>");varsItem=Request.Form("value")(1);oDm.NewTextFile(sFolder,sItem);Response.write("</div></fieldset>"+"<inputtype='button'value='新建完成,请刷新主窗口'style='width:100%;'onclick='window.close();'>"+this.HtmlFoot);Response.end();};Cc_Dm4.Rename=function(){try{varsItems=Request.Form("Item")(1);varsValue=Request.Form("Value")(1);varaItems=sItems.split("rn");varoDm=newCc_DiskManager;Response.write(this.HtmlHead+"<fieldset><divstyle='margin:5;'>");for(vari=0;i<aItems.length;++i){if(!i)varNewFileName=sValue.replace(/(*)/g,"");elsevarNewFileName=sValue.replace(/(*)/g,i+1);oDm.Rename(aItems[i],NewFileName);};Response.write("</div></fieldset>"+"<inputtype='button'value='更名完成,请刷新主窗口'style='width:100%;'onclick='window.close();'>"+this.HtmlFoot);};catch(e){ShowError(e);Response.write("<script>window.close();</script>");};Response.end();};/*};EndOfCcDm4*/if(sTarget==sSelfPath){ShowError(newError(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>COCOONOnlineDiskManager4.51</title><metahttp-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=newFunction("event.cancelBubble=true;"));};.panelLeft{width:22%;vertical-align:top;text-overflow:ellipsis;overflow:hidden;text-align:left;propertyarea:expression(onclick=newFunction("event.cancelBubble=true;"));};.panelInnerHead{width:100%;margin:10px10px0px10px;padding:5px;overflow:hidden;text-overflow:ellipsis;background-color:#eeeeee;};.panelInner{width:100%;margin:0px10px0px10px;padding:5px;overflow:hidden;text-overflow:ellipsis;border:1pxsolid#eeeeee;};.divMenu{position:absolute;border:1pxsolidblack;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:1pxsolidgray;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><STYLEid="view_2"<%=(sShowSmall=="2"?"":"disabled")%>>/*详细样式*/.ItemStyle{width:100%;height:18px;text-align:left;margin:1px;border:1pxsloidwhite;white-space:nowrap;};.ItemStyleSelected{width:100%;height:18px;text-align:left;margin:1px;border:1pxsloidwhite;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><STYLEid="view_1"<%=(sShowSmall=="1"?"":"disabled")%>>/*列表样式*/.ItemStyle{width:240px;height:18px;text-align:left;margin:1px;border:1pxsloidwhite;};.ItemStyleSelected{width:240px;height:18px;text-align:left;margin:1px;border:1pxsloidwhite;};.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><STYLEid="view_0"<%=(sShowSmall=="0"?"":"disabled")%>>/*图标样式*/.ItemStyle{width:65px;height:50px;text-align:center;margin:5px;padding:3px;border:1pxsloidwhite;};.ItemStyleSelected{width:65px;height:50px;text-align:center;margin:5px;padding:3px;border:1pxsloidwhite;};.ItemIconStyle{font-size:28pt;vertical-align:baseline;};.ItemTitle{text-overflow:ellipsis;overflow:hidden;width:100%;};.detail0{};.detail1,.detail2,.detail3,.detail4{display:none;};</STYLE><scriptlanguage="javascript">varoDocument=document;varsUrl="<%=sUrl%>";SelectedItem=SpanItem=IconItem=PanelInner=PanelTemplet=newObject();InitComplete=false;oDocument.onselectstart=newFunction("event.returnValue=false;");oDocument.onclick=newFunction("clearSelect();");window.onload=functioninit(){SpanItem=oDocument.getElementsByName("span_item");IconItem=oDocument.getElementsByName("icon_item");PanelInner=oDocument.getElementById("PanelInner");PanelTemplet=oDocument.getElementById("PanelTemplet");};oDocument.onkeydown=functionselectAll(){if((event.keyCode==97||event.keyCode==65)&&event.ctrlKey){clearSelect(true);varb=oDocument.getElementsByName("span_item");for(vari=1;i<IconItem.length;++i)ItemSelect(b[i],i);PanelInner.innerHTML="已选定"+(i-1)+"个对象。";};};functiongetFirstSelectedItem(){varm=Number.POSITIVE_INFINITY;for(varxinSelectedItem)if(parseInt(x)<m)m=parseInt(x);if(m==Number.POSITIVE_INFINITY)return1;returnm;};functionItemSelect(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;deleteSelectedItem[n];if(!b)PanelInner.innerHTML=PanelTemplet.innerHTML;};};functiondomenu(o,n){event.cancelBubble=true;if(event.shiftKey){varx=getFirstSelectedItem();clearSelect(true);varb=oDocument.getElementsByName(o.id);for(vari=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);};functionclearSelect(b){for(varxinSelectedItem){SelectedItem[x].checked=false;SelectedItem[x].className="ItemStyle";deleteSelectedItem[x];};if(!b)PanelInner.innerHTML=PanelTemplet.innerHTML;if(oDocument.popDivOpened){oDocument.popDivOpened.style.display='none';oDocument.popDivOpened=null;};};functiondoExec(o){varn=o.Cc_FilePath;vart=parseInt(o.Cc_FileType);if(t<0){alert('设备未就绪');return;};elseif(isNaN(t)){/*回首页*/location.href=sUrl;return;};elseif(t&16){/*Folder*/location.href=sUrl+"?a=f&t="+n;return;};varr="."+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();};};functionActionWin(sAction){with(oDocument.getElementById("formAction")){switch(sAction){case"rename":varsValue=prompt('*支持按数字顺序批量重命名,模板格式:"NewFileName(*).Ext"','请输新的文件名');if(!sValue)return;action="<%=sUrl%>?a=r";break;case"newDir":varsValue=prompt('新建文件夹','请新文件夹名');if(!sValue)return;action="<%=sUrl%>?a=nd";break;case"newTextFile":varsValue=prompt('新建文本文件','新建文本文档.txt');if(!sValue)return;if(sValue.toLowerCase().indexOf(".txt")<0)if(confirm('文本文件的扩展名为".txt",您刚才输入的文件名中没有包含该后缀。rnrn点击"确定"增加该后缀,点击"取消"保持您输入的文件名'))sValue+=".txt";action="<%=sUrl%>?a=ntf";break;default:action="<%=sUrl%>?a=a";};vara=newArray();varoWin=window.open('about:blank','CcActionWin','width=360,height=80');for(varxinSelectedItem)a[a.length]=SelectedItem[x].Cc_FilePath;Item.value=a.join("rn");Action.value=sAction;Value.value=sValue;submit();oWin.focus();};};functiondoAction(sAction){switch(sAction){case"paste":ActionWin("paste");return;case"newDir":ActionWin("newDir");return;case"newTextFile":ActionWin("newTextFile");return;};for(varxinSelectedItem){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;};};};functionShowDoAction(n){varsDivName;switch(n){case'new':varsDivName="divDoActionNew";break;};varo=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><divid="divDoActionNew"style="position:absolute;height:320;width:100;left:100;top:100;z-index:9;display:none"><divclass="popDivTitle">新建</div><divclass="popDiv"><divonmouseover="className='leftLinkItemOver'"onmouseout="className='leftLinkItem'"class="leftLinkItem"onclick="doAction('newDir');">文件夹</div><divonmouseover="className='leftLinkItemOver'"onmouseout="className='leftLinkItem'"class="leftLinkItem"onclick="doAction('newTextFile');">文本文件</div></div></div><formid="formAction"method=posttarget=CcActionWinstyle="margin:0"><inputtype="hidden"name="Item"><inputtype="hidden"name="Action"><inputtype="hidden"name="Value"></form><divstyle="height:91%;"align="right"><spanclass="panelLeft"><divclass="panelInnerHead"style="font-weight:bolder">COCOONStudio<br>OnlineDiskManager4.51</div><divclass="PanelInner">视图:<ahref="<%=sUrl+"?s=0&"+Request.QueryString%>"class="leftLink">图标</a><ahref="<%=sUrl+"?s=1&"+Request.QueryString%>"class="leftLink">列表</a><ahref="<%=sUrl+"?s=2&"+Request.QueryString%>"class="leftLink">详细</a><br><span>操作:<ahref="javascript:doAction();"class="leftLink">下载</a><ahref="javascript:doAction('edit');"class="leftLink">编辑</a><ahref="javascript:doAction('show');"class="leftLink">显示</a><br><ahref="javascript:doAction('copy');"class="leftLink">复制</a><ahref="javascript:doAction('cut');"class="leftLink">剪切</a><ahref="javascript:doAction('paste');"class="leftLink">粘贴</a><br><ahref="javascript:void(0);"onclick="ShowDoAction('new');"class="leftLink"onfocus=blur()>新建</a><ahref="javascript:doAction('rename');"class="leftLink">更名</a><ahref="javascript:doAction('delete');"class="leftLink">删除</a></div></span><br><divclass="PanelInner"id="PanelInner"><%Cc_Dm4.ShowCurrentFolder(sTarget)%></div><divid="PanelTemplet"style="display:none"><%Cc_Dm4.ShowCurrentFolder(sTarget)%></div></span><scriptlanguage=javascript>PanelInner=oDocument.getElementById("PanelInner");PanelTemplet=oDocument.getElementById("PanelTemplet");</script><spanstyle="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><divstyle="width:100%;height:9%;text-align:center;vertical-align:bottom;"><tablestyle="width:100%;height:100%;"border=0cellpadding="0"cellspacing="0"><tr><tdvalign="middle"style="text-align:center">警告:COCOONStudio不对使用本工具进行违法行文承担任何责任!<br>COCOONOnlineDiskManager4.51-COCOONStudio(<ahref="http://www.ccopus.com"target=_blank>www.ccopus.com</a>)<scriptlanguage=javascriptsrc="http://www.ccopus.com/_js/dm4_chkupdate.js"></script></td></tr></table></div></body></html>

<>

【asp javascript在线管理】相关文章:

asp 在线人数统计代码

asp调用二级分类代码

在线人数写法

javascript asp教程第十二课---session对象

asp 在线调查系统

asp querystring使用教程

aspjpeg组件使用方法

ASP制作在线人数统计实例

asp html代码转安全ascii代码

asp 中常用的文件处理函数

精品推荐
分类导航