⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 file.asa

📁 oa系统源码 asp.net前台 sqlserver数据库
💻 ASA
📖 第 1 页 / 共 3 页
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Server.ScriptTimeOut=200
Dim objFSO,strRootFolder,currentfolder,prefix,DBDriver
DBDriver = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" 
Set objFSO = CreateObject("Scripting.FileSystemObject")

	strRootFolder = Server.MapPath("/")
if session("currentfolder")="" then
session("currentFolder")=strrootfolder
end if
scriptname = Request.ServerVariables("SCRIPT_NAME")    

%>
<html><head>
<title>File Manager</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
td {  font-size: 9pt}
a:link {  font-size: 9pt; color: #000000; text-decoration: none}
a:hover {  color: red; text-decoration: underline}
a:visited {  font-size: 9pt; text-decoration: none; color: #000000}
.clDescription { BORDER-RIGHT: #999999 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #999999 1px solid; PADDING-LEFT: 3px; FONT-SIZE: 11px; PADDING-BOTTOM: 3px; BORDER-LEFT: #999999 1px solid; WIDTH: 200px; PADDING-TOP: 3px; BORDER-BOTTOM: #999999 1px solid; FONT-FAMILY: verdana,arial,helvetica; BACKGROUND-COLOR: #FFFFCC}
#divDescription {Z-INDEX: 200; VISIBILITY: hidden; POSITION: absolute; background-color: #FFFFCC;}
#divlinks {	Z-INDEX: 1; LEFT: 100px; POSITION: absolute; TOP: 200px}
-->
</style>
<script language="JavaScript">
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;	
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()

fromX=20 //How much from the actual mouse X should the description box appear?
fromY=10 ///How much from the actual mouse Y should the description box appear?

//To set the font size, font type, border color or remove the border or whatever,
//change the clDescription class in the stylesheet.

//Makes crossbrowser object.
function makeObj(obj){								
   	this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?document.layers[obj]:0;	
   	this.wref=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj].document:0;		
	this.writeIt=b_writeIt;																
	return this
}

function b_writeIt(text){if(bw.ns4){this.wref.write(text);this.wref.close()}
else this.wref.innerHTML=text}

//Capturing mousemove
var descx,descy;
function popmousemove(e){descx=bw.ns4?e.pageX:event.x; descy=bw.ns4?e.pageY:event.y}

//Initiates page
var isLoaded;
function popupInit(){
    oDesc=new makeObj('divDescription')
    if(bw.ns4)document.captureEvents(Event.MOUSEMOVE)
    document.onmousemove=popmousemove;
    isLoaded=true;
}	
//Shows the messages
function popup(messages){

    if(isLoaded){
	oDesc.writeIt('<span class="clDescription">'+messages+'</span>')
	if(bw.ie5 || bw.ie6) descy=descy+document.body.scrollTop
	oDesc.css.left=descx+fromX; oDesc.css.top=descy+fromY
	oDesc.css.visibility='visible'
    }
}
//Hides it
function popout(num){
	if(isLoaded) oDesc.css.visibility='hidden'
}

//initiates page on pageload.
onload=popupInit;

</script>
</head>
<body bgcolor="#FFFFFF">
<DIV id=divDescription> 
  <!--Empty div-->
</DIV>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr align="center"> 
    <td><font size="3">文件管理系统</font></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<%
'----------------------------拷贝文件---------------------------------------------
if request("op")="copy" then%>
<%
dim src,dst,fcopy
if Request("src")<>"" and Request("dst")<>"" then
src=Trim(Request("src"))
dst=Trim(Request("dst"))
set fcopy = objFSO.GetFile(src)
fcopy.Copy(dst)
Response.Write("Copy "&src&"<BR> to "&dst&" <BR>done!")
end if
%>
<form name="form1" method="post" action="<%=scriptname%>">
  <table width="100%" border="0" cellspacing="0" cellpadding="5">
    <tr> 
      <td align="center">
	  <input type="hidden" name="op" value="copy">
	  源文件: 
        <input name="src" type="text" id="src" value="<%=Request("src")%>" size="30"></td>
    </tr>
    <tr> 
      <td align="center">目标文件:<input name="dst" type="text" id="dst" size="30" value="<%=strrootfolder%>"></td>
    </tr>
    <tr> 
      <td align="center"><input type="submit" value="Submit"></td>
    </tr>
  </table>
</form>

<%
Response.End
end if
%>
<%
'----------------------------修改文件---------------------------------------------
if request("op")="edit" then%>
<%dim filename,TextStream
filename=request("filename")
set TextStream=objFSO.OpenTextFile(filename)
call header
%>
<form name="form" method="post" action="<%=scriptname%>" >
  <table width="100%" border="1" cellspacing="0" cellpadding="10" bordercolorlight="#000000" bordercolordark="#FFFFFF">
    <tr align="center"> 
      <td height="12"> <p> 
          <input type="hidden" name="op" value="save">
          <input type="hidden" name="folder" value="<%=objFSO.GetParentFolderName(request("filename"))%>">
          文件名:<%=objFSO.GetFileName(request("filename"))%> 
          <input type="hidden" name="newfilename" value="<%=objFSO.Getfilename(request("filename"))%>">
        </p>
        </td>
    </tr>
    <tr align="center"> 
      <td height="344"> 文件内容(文件大小不能超过<font color="#FF0000">2M</font>)<br>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="93%" align="center" rowspan="2"> 
              <textarea name="content" rows="26" cols="90" wrap="OFF"><%=Server.HTMLEncode(TextStream.Readall)%></textarea>
            </td>
            <td width="7%" valign="top" height="210"> 
              <input type="submit" name="Submit" value="保存文件">
            </td>
          </tr>
          <tr>
            <td width="7%" valign="bottom"> 
              <input type="submit" name="Submit" value="保存文件">
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</form>

<%call copyright
Response.End
end if
%>
<%
'----------------------------保存文件---------------------------------------------
if request("op")="save" then%>
<%dim objtext,fullname
on error resume next
fullname=session("currentfolder") & "\"& request("newfilename")
'response.write fullname
set objtext=objFSO.CreateTextFile(fullname,True)
objtext.WriteLine (request("content"))
objtext.close
if err<>0 then
response.write "保存文件时发生错误,可能是您没有写入权限"
response.end
else
response.redirect scriptname
end if
%>
<%
Response.End
end if
%>
<%
'----------------------------新建文件---------------------------------------------
if request("op")="new" then%>
<%dim folder
folder=request("folder")
call header
%>
<form name="form" method="post" action="<%=scriptname%>" >
  <table width="100%" border="1" cellspacing="0" cellpadding="10" bordercolorlight="#000000" bordercolordark="#FFFFFF">
    <tr align="center"> 
      <td> 
        <input type="hidden" name="folder" value="<%=folder%>">
		<input type="hidden" name="op" value="save">
        文件名(包括扩展名):
<input type="text" name="newfilename" maxlength="30" size="20">
      </td>
    </tr>
    <tr align="center"> 
      <td height="344"> 文件内容(文件大小不能超过<font color="#FF0000">2M</font>)<br>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="93%" align="center" rowspan="2"> 
              <textarea name="content" rows="30" cols="90"></textarea>
            </td>
            <td width="7%" valign="top" height="210"> 
              <input type="submit" name="Submit" value="保存文件">
            </td>
          </tr>
          <tr>
            <td width="7%" valign="bottom"> 
              <input type="submit" name="Submit" value="保存文件">
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</form>

<%call copyright
Response.End
end if
%>

<%
'----------------------------删除文件---------------------------------------------
if request("op")="del" then%>
<%
filename=request("filename")
objFSO.Deletefile filename
response.redirect scriptname
Response.End
end if
%>
<%
'----------------------------删除文件夹---------------------------------------------
if request("op")="delfolder" then%>
<%
foldername=request("folder")
objFSO.DeleteFolder foldername
response.redirect scriptname&"?folder="&objFSO.GetParentFolderName(foldername)
Response.End
end if
%>
<%
'----------------------------上传文件---------------------------------------------
if request("op")="upload" then
	call header  
if request("op2")="" then%>
<form name="upload" method="post" action="<%=scriptname%>?op=upload&op2=save" enctype="multipart/form-data" >
  <br>
  <input type="hidden" name="act" value="upload">
  <br>
  <table width="71%" border="1" cellspacing="0" cellpadding="5" align="center" bordercolordark="#CCCCCC" bordercolorlight="#000000">
    <tr> 
      <td height="22" align="center" valign="middle">文件上传</td>
    </tr>
    <tr> 
      <td height="92"> 
        <script language="javascript">
	  function setid()
	  {
	  str='<br>';
	  if(!window.upload.upcount.value)
	   window.upload.upcount.value=1;
 	  for(i=1;i<=window.upload.upcount.value;i++)
	     str+='文件'+i+':<input type="file" name="file'+i+'" style="width:400" class="tx1"><br><br>';
	  window.upid.innerHTML=str+'<br>';
	  }
	  </script>
        <ul>
          <li> 需要上传的个数 
            <input type="text" name="upcount" value="1">
            <input type="button" onclick="setid();" value="设定">
          </li>
          <br>
          <br>
          <li>上传到: 
            <input type="text" name="filepath" style="width:350" value="<%=request("folder")%>">
          </li>
        </ul>  
      </td>  
    </tr>  
    <tr align="center" valign="middle">   
      <td align="left" id="upid" height="122"> 文件1: 
        <input type="file" name="file1" style="width:400" value="">  
      </td>  
    </tr>  
    <tr align="center" valign="middle" bgcolor="#eeeeee">   
      <td height="24" align="center" bgcolor="#FFEFDF">   
        <input type="submit" name="Submit" value="提交">
      </td>  
    </tr>  
  </table>  
</form>  
<script language="javascript">  
  
setid();  
</script>
<%else%>
<%
'----------------------------------------上传类定义------------------------------
%>
<script language="VBScript" runat="server">
Dim oUpFileStream

Class UpFile_Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -