您目前尚未登陆,请选择【登陆】或【注册
首页->全站代码->MyWebPages51aspx汉化最终版>>App-Code/FCKEditor/FileBrowserConnector.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:MyWebPages51aspx汉化最终版
普通视图
		            
1/* 2 * FCKeditor - The text editor for internet 3 * Copyright (C) 2003-2005 Frederico Caldeira Knabben 4 * 5 * Licensed under the terms of the GNU Lesser General Public License: 6 * http://www.opensource.org/licenses/lgpl-license.php 7 * 8 * For further information visit: 9 * http://www.fckeditor.net/ 10 * 11 * "Support Open Source software. What about a donation today?" 12 * 13 * File Name: FileBrowserConnector.cs 14 * This is the code behind of the connector.aspx page used by the 15 * File Browser. 16 * 17 * File Authors: 18 * Frederico Caldeira Knabben (fredck@fckeditor.net) 19 */ 20 21using System; 22using System.Globalization; 23using System.Xml; 24using System.Web; 25using System.IO; 26using System.Web.SessionState; 27 28namespace FredCK.FCKeditorV2 29{ 30 public class FileBrowserConnector : FileWorkerBase 31 { 32 protected override void OnLoad(EventArgs e) 33 { 34 // Get the main request informaiton. 35 string sCommand = Request.QueryString["Command"]; 36 if (sCommand == null) return; 37 38 string sResourceType = Request.QueryString["Type"]; 39 if (sResourceType == null) return; 40 41 string sCurrentFolder = Request.QueryString["CurrentFolder"]; 42 if (sCurrentFolder == null) return; 43 44 // Check the current folder syntax (must begin and start with a slash). 45 if (!sCurrentFolder.EndsWith("/")) 46 sCurrentFolder += "/"; 47 if (!sCurrentFolder.StartsWith("/")) 48 sCurrentFolder = "/" + sCurrentFolder; 49 50 // File Upload doesn't have to return XML, so it must be intercepted before anything. 51 if (sCommand == "FileUpload") 52 { 53 this.FileUpload(sResourceType, sCurrentFolder); 54 return; 55 } 56 57 // Cleans the response buffer. 58 Response.ClearHeaders(); 59 Response.Clear(); 60 61 // Prevent the browser from caching the result. 62 Response.CacheControl = "no-cache"; 63 64 // Set the response format. 65 Response.ContentEncoding = System.Text.UTF8Encoding.UTF8; 66 Response.ContentType = "text/xml"; 67 68 XmlDocument oXML = new XmlDocument(); 69 XmlNode oConnectorNode = CreateBaseXml(oXML, sCommand, sResourceType, sCurrentFolder); 70 71 // Execute the required command. 72 switch (sCommand) 73 { 74 case "GetFolders": 75 this.GetFolders(oConnectorNode, sResourceType, sCurrentFolder); 76 break; 77 case "GetFoldersAndFiles": 78 this.GetFolders(oConnectorNode, sResourceType, sCurrentFolder); 79 this.GetFiles(oConnectorNode, sResourceType, sCurrentFolder); 80 break; 81 case "CreateFolder": 82 this.CreateFolder(oConnectorNode, sResourceType, sCurrentFolder); 83 break; 84 } 85 86 // Output the resulting XML. 87 Response.Write(oXML.OuterXml); 88 89 Response.End(); 90 } 91 92 Base XML Creation 114 115 Command Handlers 254 255 Directory Mapping 294 } 295}
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:MyWebPages51aspx汉化最终版