ckfinder/_source/Connector/CommandHandlers/GetFilesCommandHandler.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
 * CKFinder
 * ========
 * http://ckfinder.com
 * Copyright (C) 2007-2012, CKSource - Frederico Knabben. All rights reserved.
 *
 * The software, this file and its contents are subject to the CKFinder
 * License. Please read the license.txt file before using, installing, copying,
 * modifying or distribute this file or part of its contents. The contents of
 * this file is part of the Source Code of CKFinder.
 */

using System;
using System.Xml ;
using System.Globalization ;

namespace CKFinder.Connector.CommandHandlers
{
	internal class GetFilesCommandHandler : XmlCommandHandlerBase
	{
		public GetFilesCommandHandler() : base()
		{
		}

		protected override void BuildXml()
		{
			if ( !this.CurrentFolder.CheckAcl( AccessControlRules.FileView ) )
			{
				ConnectorException.Throw( Errors.Unauthorized );
			}

			// Map the virtual path to the local server path.
			string sServerDir = this.CurrentFolder.ServerPath ;
			bool bShowThumbs = Request.QueryString["showThumbs"] != null && Request.QueryString["showThumbs"].ToString().Equals( "1" ) ;

			// Create the "Files" node.
			XmlNode oFilesNode = XmlUtil.AppendElement( this.ConnectorNode, "Files" ) ;

			System.IO.DirectoryInfo oDir = new System.IO.DirectoryInfo( sServerDir ) ;
			System.IO.FileInfo[] aFiles = oDir.GetFiles() ;

			for ( int i = 0 ; i < aFiles.Length ; i++ )
			{
				System.IO.FileInfo oFile = aFiles[ i ];
				string sExtension = System.IO.Path.GetExtension( oFile.Name ) ;

				if ( Config.Current.CheckIsHiddenFile( oFile.Name ) )
					continue;

				if ( !this.CurrentFolder.ResourceTypeInfo.CheckExtension( sExtension ) )
					continue;

				Decimal iFileSize = Math.Round( (Decimal)oFile.Length / 1024 ) ;
				if ( iFileSize < 1 && oFile.Length != 0 ) iFileSize = 1 ;

				// Create the "File" node.
				XmlNode oFileNode = XmlUtil.AppendElement( oFilesNode, "File" ) ;
				XmlUtil.SetAttribute( oFileNode, "name", oFile.Name );
				XmlUtil.SetAttribute( oFileNode, "date", oFile.LastWriteTime.ToString( "yyyyMMddHHmm" ) );
				if ( Config.Current.Thumbnails.Enabled 
后面还有 20 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。