PanchalSoftwares.TextFinder.Library/FileHelper.cs

(开头部分) 4KB

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

//-----------------------------------------------------------------------
// <copyright file="FileHelper.cs" company="Panchal Softwares">
//     Copyright (c) Panchal Softwares. All rights reserved.
// </copyright>
// <author>Karn Panchal</author>
//-----------------------------------------------------------------------

/// <summary>
/// Namespace Text Finder Library.
/// </summary>
namespace PanchalSoftwares.TextFinder.Library
{
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text.RegularExpressions;

    /// <summary>
    /// Class File Helper.
    /// </summary>
    public class FileHelper
    {
        /// <summary>
        /// Gets or sets a value indicating whether [use case sensitive search].
        /// </summary>
        /// <value>
        /// <c>true</c> if [use case sensitive search]; otherwise, <c>false</c>.
        /// </value>
        public static bool UseCaseSensitiveSearch { get; set; }

        /// <summary>
        /// Determines whether [is all directories accessible] [the specified path].
        /// </summary>
        /// <param name="path">The path.</param>
        /// <returns>
        /// Returns boolean where all directory inside root directory accessible or not.
        /// </returns>
        public static bool IsAllDirectoriesAccessible(string path)
        {
            string searchPattern = "*.txt";
            DirectoryInfo rootDirectoryInfo = new DirectoryInfo(path);
            try
            {
                List<FileInfo> tempListFileInfo = rootDirectoryInfo.EnumerateFiles(searchPattern, SearchOption.AllDirectories).ToList();
                return true;
            }
            catch
            {
                return false;
            }
        }

        /// <summary>
        /// Finds the files.
        /// </summary>
        /// <param name="pathRootDirectory">The path root directory.</param>
        /// <param name="extension">The extension.</param>
        /// <returns>
        /// Returns list of files path.
        /// </returns>
后面还有 78 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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