目录结构:
TOOTDB/
toot_cn$hzf.mdb
console/
consolePanle.aspx
lang.xml
RunSQLQuery.aspx
TOOTcnMMC.swf
RtnSiteFileData.aspx
editor/ ============= fckeditor 编辑器目录,另外下载
consolePanle.aspx 代码如下:
<%@ Page Language="C#" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server" language="C#">
private void Page_Load(object sender, System.EventArgs e)
{
string msg = "";
System.Collections.Specialized.NameValueCollection settings =
System.Configuration.ConfigurationSettings.AppSettings;
string db ="../"+ settings["DBRelPos"];
string connStr = settings["connStr"];
connStr += Server.MapPath(db);
string query = "Select sessionID FROM LoginInfo where available=true and sessionID= '" + Request.QueryString["SID"] + "'";
string query2 = "update LoginInfo set available=false where available = true and datediff(/"n/",createtime, now()) >120 ";
OleDbConnection conn = null;
OleDbCommand command = null;
try
{
conn = new OleDbConnection(connStr);
command = new OleDbCommand(query2, conn);
}
catch (Exception ex)
{
msg = "Error when create connection : " + ex.Message;
}
try
{
conn.Open();
command.ExecuteNonQuery();
command.CommandText = query;
OleDbDataReader reader = command.ExecuteReader();
if (!reader.HasRows)
{
reader.Close();
conn.Close();
Response.Write("Invalidate Username or Password");
Response.Redirect("/index.htm");
Response.End();
}
reader.Close();
conn.Close();
}
catch (Exception ex)
{
msg = "Error : " + ex.Message;
}
Response.Write(msg);
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>TOOTcn网页后台管理系统</title>
<script type="text/javascript" src="fckeditor.js"></script>
<script type="text/javascript">
<!--
// FCKeditor_OnComplete is a special function that is called when an editor
// instance is loaded ad available to the API. It must be named exactly in
// this way.
function FCKeditor_OnComplete( editorInstance )
{
// Show the editor name and description in the browser status bar.
//document.getElementById('eMessage').innerHTML = 'Instance "' + editorInstance.Name + '" loaded - ' + editorInstance.Description ;
ChangeSaveBtnStatue(1);
// Show this sample buttons.
//document.getElementById('eButtons').style.visibility = '' ;
}
function InsertHTML()
{
// Get the editor instance that we want to interact with.
var oEditor = FCKeditorAPI.GetInstance('TOOTcnXEditor') ;
// Check the active editing mode.
if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )
{
// Insert the desired HTML.
oEditor.InsertHtml( 'HTML Content Here' ) ;
}
else
alert( 'You must be on WYSIWYG mode!' ) ;
}
function SetContents( contentsData)
{
// Get the editor instance that we want to interact with.
var oEditor = FCKeditorAPI.GetInstance('TOOTcnXEditor') ;
// Set the editor contents (replace the actual one).
oEditor.SetData( contentsData ) ;
}
function GetContents()
{
// Get the editor instance that we want to interact with.
var oEditor = FCKeditorAPI.GetInstance('TOOTcnXEditor') ;
SendTextData2Flash(oEditor.GetXHTML( true ));
// Get the editor contents in XHTML.
//alert( oEditor.GetXHTML( true ) ) ; // "true" means you want it formatted.
}
function GetLength()
{
// This functions shows that you can interact directly with the editor area
// DOM. In this way you have the freedom to do anything you want with it.
// Get the editor instance that we want to interact with.
var oEditor = FCKeditorAPI.GetInstance('TOOTcnXEditor') ;
// Get the Editor Area DOM (Document object).
var oDOM = oEditor.EditorDocument ;
var iLength ;
// The are two diffent ways to get the text (without HTML markups).
// It is browser specific.
if ( document.all ) // If Internet Explorer.
{
iLength = oDOM.body.innerText.length ;
}
else // If Gecko.
{
var r = oDOM.createRange() ;
r.selectNodeContents( oDOM.body ) ;
iLength = r.toString().length ;
}
//alert( 'Actual text length (without HTML markups): ' + iLength + ' characters' ) ;
}
function GetInnerHTML()
{
// Get the editor instance that we want to interact with.
var oEditor = FCKeditorAPI.GetInstance('TOOTcnXEditor') ;
//alert( oEditor.EditorDocument.body.innerHTML ) ;
}
function CheckIsDirty()
{
// Get the editor instance that we want to interact with.
var oEditor = FCKeditorAPI.GetInstance('TOOTcnXEditor') ;
// alert( oEditor.IsDirty() ) ;
return oEditor.IsDirty();
}
-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2008 Adobe Systems Incorporated. All rights reserved.
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
var version;
var axo;
var e;
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
try {
// version will be set for 7.X or greater players
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
version = axo.GetVariable("$version");
} catch (e) {
}
if (!version)
{
try {
// version will be set for 6.X players only
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
// installed player is some revision of 6.0
// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
// so we have to be careful.
// default to the first public version
version = "WIN 6,0,21,0";
// throws if AllowScripAccess does not exist (introduced in 6.0r47)
axo.AllowScriptAccess = "always";
// safe to call for 6.0r47 or greater
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 4.X or 5.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 3.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = "WIN 3,0,18,0";
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 2.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
version = "WIN 2,0,0,11";
} catch (e) {
version = -1;
}
}
return version;
}
// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
// NS/Opera version >= 3 check for Flash plugin in plugin array
var flashVer = -1;
if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
var descArray = flashDescription.split(" ");
var tempArrayMajor = descArray[2].split(".");
var versionMajor = tempArrayMajor[0];
var versionMinor = tempArrayMajor[1];
var versionRevision = descArray[3];
if (versionRevision == "") {
versionRevision = descArray[4];
}
if (versionRevision[0] == "d") {
versionRevision = versionRevision.substring(1);
} else if (versionRevision[0] == "r") {
versionRevision = versionRevision.substring(1);
if (versionRevision.indexOf("d") > 0) {
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
}
}
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
}
}
// MSN/WebTV 2.6 supports Flash 4
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
// WebTV 2.5 supports Flash 3
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
// older WebTV supports Flash 2
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
else if ( isIE && isWin && !isOpera ) {
flashVer = ControlVersion();
}
return flashVer;
}
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
versionStr = GetSwfVer();
if (versionStr == -1 ) {
return false;
} else if (versionStr != 0) {
if(isIE && isWin && !isOpera) {
// Given "WIN 2,0,0,11"
tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
tempString = tempArray[1]; // "2,0,0,11"
versionArray = tempString.split(","); // ['2', '0', '0', '11']
} else {
versionArray = versionStr.split(".");
}
var versionMajor = versionArray[0];
var versionMinor = versionArray[1];
var versionRevision = versionArray[2];
// is the major.revision >= requested major.revision AND the minor version >= requested minor
if (versionMajor > parseFloat(reqMajorVer)) {
return true;
} else if (versionMajor == parseFloat(reqMajorVer)) {
if (versionMinor > parseFloat(reqMinorVer))
return true;
else if (versionMinor == parseFloat(reqMinorVer)) {
if (versionRevision >= parseFloat(reqRevision))
return true;
}
}
return false;
}
}
function AC_AddExtension(src, ext)
{
if (src.indexOf('?') != -1)
return src.replace(//?/, ext+'?');
else
return src + ext;
}
function AC_Generateobj(objAttrs, params, embedAttrs)
{
var str = '';
if (isIE && isWin && !isOpera)
{
str += '<object ';
for (var i in objAttrs)
{
str += i + '="' + objAttrs[i] + '" ';
}
str += '>';
for (var i in params)
{
str += '<param name="' + i + '" value="' + params[i] + '" /> ';
}
str += '</object>';
}
else
{
str += '<embed ';
for (var i in embedAttrs)
{
str += i + '="' + embedAttrs[i] + '" ';
}
str += '> </embed>';
}
document.write(str);
}
function AC_FL_RunContent(){
var ret =
AC_GetArgs
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
, "application/x-shockwave-flash"
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_SW_RunContent(){
var ret =
AC_GetArgs
( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
, null
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
var ret = new Object();
ret.embedAttrs = new Object();
ret.params = new Object();
ret.objAttrs = new Object();
for (var i=0; i < args.length; i=i+2){
var currArg = args[i].toLowerCase();
switch (currArg){
case "classid":
break;
case "pluginspage":
ret.embedAttrs[args[i]] = args[i+1];
break;
case "src":
case "movie":
args[i+1] = AC_AddExtension(args[i+1], ext);
ret.embedAttrs["src"] = args[i+1];
ret.params[srcParamName] = args[i+1];
break;
case "onafterupdate":
case "onbeforeupdate":
case "onblur":
case "oncellchange":
case "onclick":
case "ondblclick":
case "ondrag":
case "ondragend":
case "ondragenter":
case "ondragleave":
case "ondragover":
case "ondrop":
case "onfinish":
case "onfocus":
case "onhelp":
case "onmousedown":
case "onmouseup":
case "onmouseover":
case "onmousemove":
case "onmouseout":
case "onkeypress":
case "onkeydown":
case "onkeyup":
case "onload":
case "onlosecapture":
case "onpropertychange":
case "onreadystatechange":
case "onrowsdelete":
case "onrowenter":
case "onrowexit":
case "onrowsinserted":
case "onstart":
case "onscroll":
case "onbeforeeditfocus":
case "onactivate":
case "onbeforedeactivate":
case "ondeactivate":
case "type":
case "codebase":
case "id":
ret.objAttrs[args[i]] = args[i+1];
break;
case "width":
case "height":
case "align":
case "vspace":
case "hspace":
case "class":
case "title":
case "accesskey":
case "name":
case "tabindex":
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
break;
default:
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
}
}
ret.objAttrs["classid"] = classid;
if (mimeType) ret.embedAttrs["type"] = mimeType;
return ret;
}
// -->
</script>
<script language="javascript" type="text/javascript">
function ObjectReff( targetObj ){
var ie = navigator.appName.indexOf("Microsoft") != -1;
var Obj = (ie) ? window.document.getElementById(targetObj) : document.getElementsByName(targetObj);
return Obj;
}
function FlashSendTextData(textData){
SetContents(textData);
ChangeSaveBtnStatue(0);
window.scroll(0,640);
var oEditor = FCKeditorAPI.GetInstance('TOOTcnXEditor') ;
oEditor.focus();
}
function SendTextData2Flash(textData ){
ObjectReff("TOOTcnMMc").JavascriptSendTextDataHere(textData );
ChangeSaveBtnStatue(1);
window.scroll(0,0);
ObjectReff("TOOTcnMMc").focus();
}
function FMShowHide(){
if(divFileManager.className=="divFileManagerHide")
divFileManager.className="divFileManagerShow";
else
divFileManager.className="divFileManagerHide";
}
function ChangeSaveBtnStatue(IsEnable){
ObjectReff("btn_Save").disabled=IsEnable;
if(!IsEnable)
ObjectReff("TOOTcnMMc").DisableMulButton( );
}
</script>
<style type="text/css">
li {display:inline; margin: 4px; padding:4px; border-right:solid 1px #000;}
.divFileManagerShow{visibility:collapse; display:block; }
.divFileManagerHide{ visibility:hidden; display:none;}
</style>
</head>
<body style="background-color:White; margin:0; padding:0;" >
<form id="form1" runat="server">
<div>
<div id="menubar" style=" margin-top:1em; ">
<div id="nav">
<ul style="display: table-cell;">
<li ><a href="../index.htm"><b>HOME</b></a></li>
<li><a href="javascript:FMShowHide()"><b>Show/Hide FileManager</b></a></li>
</ul>
</div>
</div>
<div class="clearfix"></div>
<div id="divFileManager" class="divFileManagerHide">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="980" height="400" id="FileManager" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="fileManager.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="fileManager.swf" quality="high" bgcolor="#ffffff" width="980" height="400" name="FileManager" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
</div>
<div class="clearfix"></div>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="980" height="680" id="TOOTcnMMc" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="TOOTcnMMc.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="TOOTcnMMc.swf" quality="high" bgcolor="#ffffff" width="980" height="680" name="TOOTcnMMc" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
<div class="clearfix"></div>
<hr />
<div style="text-align:right; padding:4px; background-color:#dddddd; "><input id="btn_Save" type="button" value="保存编辑结果" style="font-size:20px; padding:2px 1em 2px 1em; font-weight:bold; letter-spacing:4px;" οnclick="GetContents();" /></div>
<script type="text/javascript">
<!--
var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('console')) ;
var oFCKeditor = new FCKeditor( 'TOOTcnXEditor' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.Value = '' ;
oFCKeditor.Height = 600;
oFCKeditor.Create() ;
//-->
</script>
<br /><br /><br /><br />
</div>
</form>
</body>
</html>