温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载: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: FileWorkerBase.cs 14
* Base class used by the FileBrowserConnector and Uploader. 15
* 16
* File Authors: 17
* Frederico Caldeira Knabben (fredck@fckeditor.net) 18
*/ 19
20
using System; 21
22
namespace FredCK.FCKeditorV2 23
{ 24
public abstract class FileWorkerBase : System.Web.UI.Page 25
{ 26
private const string DEFAULT_USER_FILES_PATH = "~/App_Data/UserImages/"; 27
28
private string sUserFilesPath ; 29
private string sUserFilesDirectory ; 30
31
protected string UserFilesPath 32
{ 33
get 34
{ 35
if ( sUserFilesPath == null ) 36
{ 37
// Try to get from the "Application". 38
sUserFilesPath = (string)Application["FCKeditor:UserFilesPath"] ; 39
40
// Try to get from the "Session". 41
if ( sUserFilesPath == null || sUserFilesPath.Length == 0 ) 42
{ 43
sUserFilesPath = (string)Session["FCKeditor:UserFilesPath"] ; 44
45
// Try to get from the Web.config file. 46
if ( sUserFilesPath == null || sUserFilesPath.Length == 0 ) 47
{ 48
sUserFilesPath = System.Configuration.ConfigurationSettings.AppSettings["FCKeditor:UserFilesPath"] ; 49
50
// Otherwise use the default value. 51
if ( sUserFilesPath == null || sUserFilesPath.Length == 0 ) 52
sUserFilesPath = DEFAULT_USER_FILES_PATH ; 53
54
// Try to get from the URL. 55
if ( sUserFilesPath == null || sUserFilesPath.Length == 0 ) 56
{ 57
sUserFilesPath = Request.QueryString["ServerPath"] ; 58
} 59
} 60
} 61
62
// Check that the user path ends with slash ("/") 63
if ( ! sUserFilesPath.EndsWith("/") ) 64
sUserFilesPath += "/" ; 65
} 66
return sUserFilesPath ; 67
} 68
} 69
70
/// <summary> 71
/// The absolution path (server side) of the user files directory. It 72
/// is based on the <see cref="FileWorkerBase.UserFilesPath"/>. 73
/// </summary> 74
protected string UserFilesDirectory 75
{ 76
get 77
{ 78
if ( sUserFilesDirectory == null ) 79
{ 80
// Get the local (server) directory path translation. 81
sUserFilesDirectory = Server.MapPath( this.UserFilesPath ) ; 82
} 83
return sUserFilesDirectory ; 84
} 85
} 86
} 87
} 88



* FCKeditor - The text editor for internet

}