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

📄 sqlcommand.ascx

📁 这是我编的一小软件。请等级等待指教。呵呵。ASP的
💻 ASCX
字号:
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="SqlCommand.ascx.cs" Inherits="Seaskyer.WebApp.skyNews.Pages.AdminMSC.SqlCommand" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<style>
body 
{
    FONT-SIZE: 12px;
    COLOR: #000000;
    FONT-FAMILY: 宋体;
    scrollbar-face-color: #DEE3E7;
    scrollbar-highlight-color: #FFFFFF;
    scrollbar-shadow-color: #DEE3E7;
    scrollbar-3dlight-color: #D1D7DC;
    scrollbar-arrow-color:  #006699;
    scrollbar-track-color: #EFEFEF;
    scrollbar-darkshadow-color: #98AAB1;
    margin:0px 0px 0px 0px;
}

</style>

<asp:Panel ID="ScreenForm" Runat="server">
	<table style="width:100%; height:100%; background:#DEEFFF;">
	<tr>
	<td valign="top" id="navi">
	</td>
	</tr>
	</table>
	<script language="javascript">
	<!--
	document.body.scroll = "yes";
	document.body.oncontextmenu = function()
	{return true;}
	parent.document.forms[0].body.focus();
	parent.document.forms[0].body.value = parent.document.forms[0].body.value;
	
	function addCommand(cmd)
	{
		parent.document.forms[0].body.value = cmd;
		parent.document.forms[0].body.focus();
	}
	//-->
	</script>
</asp:Panel>

<asp:Panel ID="ConsoleForm" Runat="server">
	<script language="javascript" type="text/javascript">
	<!--
	document.body.scroll = "no";
	document.body.oncontextmenu = function()
	{return false;}

	ie = (document.all)? true:false
	if (ie){function ctlent(eventobject){if(window.event.keyCode==13){this.sendCommand();}}}
	var i
	i = 0;
	
	
	function selectCommand(obj)
	{
		document.forms[0].body.value = (obj.options[obj.selectedIndex].value);
	}
	
	function sendCommand()
	{
		if(document.forms[0].body.innerText == "")
		{
			alert("请键入相关命令!");
			//document.forms[0].body.value = "";
			//document.forms[0].body.value = document.forms[0].body.value.replace("\n", "");
			document.forms[0].body.focus();
			return;
		}
		else
		{
			i++;
			var command;
			command = document.forms[0].body.innerText;
			
			//document.forms[0].body.value = "";
			commandList = eval('document.forms[0].haveDocommand');
			txt = "命令" + i + ":" + command;
			val = command;
			commandList.options[commandList.length] = new Option(txt,val);
			commandList.options[i].selected = true;
			if(i%2 == 0)
			{
				commandList.options[i].style.color = "#000000";
			}
			else
			{
				commandList.options[i].style.color = "#6A5ACD";
			}
			
			//提交命令
			doCommand.location.href = "/skyNews/Admin/SqlCommand.aspx?action=dosql&body=" + command + "&cmd=command" + i;
			//页面输出
			commandScreen.document.all.navi.innerHTML  = commandScreen.document.all.navi.innerHTML + "<a name=\"command" + i + "\">命令" + i + "> <a href=\"javascript:\" onclick=\"addCommand(this.title);\" title=\"" + command + "\"><font color=blue size=2>" + command + "</font></a> <img src='/skyNews/Images/Skin/enter.gif' border=0 align='absbottom'><br><div id='command"+i+"_output'></div>";
		}
		
		document.forms[0].body.value = "";
	}
	//-->
	</script>
	<table align="center" width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
	<tr>
	<td valign="top" height="10" style="padding-left:5px; padding-right:5px; padding-top:5px; background:#DEEFFF;">
		<font color="BuleViolet"><b>Sql Command 操作管理平台</b></font> Version 1.1  (<a style="CURSOR: help" onclick="openScript(this.urn,500,400,'')" urn="/skyNews/Images/Sqlcommand_Help.html" href="javascript:">Sql Command 使用帮助</a>)
		<div align="right"><font color="#c0c0c0">= 本平台直接对数据库进行操作,操作后不可恢复。因此建议您在使用前先对数据库进行备份 =</font></div>
	</td>
	</tr>
	<tr>
	<td bgcolor="#DEEFFF" height="10px">
		<hr size="1" color="white" width="100%">
	</td>
	</tr>
	<tr>
	<td>
		<iframe id="commandScreen" name="commandScreen" src="/skyNews/Admin/SqlCommand.aspx?action=screen" marginheight="0" marginwidth="0" width="100%" height="100%" scrolling="auto" frameborder="0" style="border: 1px #c0c0c0 solid"></iframe>
		<iframe id="doCommand" name="doCommand" src="/skyNews/Admin/SqlCommand.aspx?action=dosql" marginheight="0" marginwidth="0" width="0" height="0" scrolling="no"></iframe>
	</td>
	</tr>
	<tr>
	<td height="100px">
		<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" height="20px">
		<tr>
		<td width="200px">> 请在下面输入相关命令直接回车</td>
		<td></td>
		</tr>
		</table>
		<textarea onkeydown="ctlent()" title="使用 回车键(Enter) 直接执行命令" id="body" name="body" rows="5" style="width:100%;" oncontextmenu="return true;"></textarea>
		<select id="haveDocommand" name="haveDocommand" style="width:90%;color:red;background-color:#E6E6FA" onblur="selectCommand(this);document.forms[0].body.focus();" onchange="selectCommand(this);">
			<option value="" selected>请从下面选择你已经操作过的命令</option>
		</select>
		<input type="button" value="清屏" onclick="commandScreen.location.href='/skyNews/Admin/SqlCommand.aspx?action=screen';">
	</td>
	</tr>
	</table>
</asp:Panel>

<asp:Panel ID="DoSqlForm" Runat="server">
<%Response.Clear();%>
<div id="info">
	<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
	<tr>
	<td style="padding:20px;">
	<!--显示成功和错误的信息-->
	<asp:Label id="pageinfo" runat="server"></asp:Label>
	<!--用来显示Select操作显示的数据-->
	<asp:DataGrid id="selectGrid" runat="server" HeaderStyle-BackColor="#99CCFF" AlternatingItemStyle-BackColor="#F2F8FF" AlternatingItemStyle-BorderColor="#c0c0c0" HeaderStyle-ForeColor="#000000" HeaderStyle-Font-Bold="True" BorderWidth="1" BorderColor="#0099CC" CellPadding="5" CellSpacing="0" AutoGenerateColumns="True"  AllowPaging="False"></asp:DataGrid>
	</td>
	</tr>
	</table>
</div>
<asp:Label id="Label1" runat="server">
<script language="javascript">
<!--
parent.commandScreen.location.href = "/skyNews/Admin/SqlCommand.aspx?&action=screen#command0";
//-->
</script>
</asp:Label>
<%Response.End();%>
</asp:Panel>

⌨️ 快捷键说明

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