示例#1
0
        //====== Dir Print ==============================================

        // string DirectoryFilePaths = ahk.DirPrint("C:\\CCSM", true, "c:\\OutFile.txt", "*.txt", true);

        /// <summary>
        /// Prints List of Files in Directory to String or New Text File
        /// </summary>
        /// <param name="SearchDir">Directory to Loop through for File Paths</param>
        /// <param name="OutFile">If path provided, writes contents of directory to this to new/existing text file</param>
        /// <param name="Recurse">Option to Search Files in Subdirectories (aka Recurse) Default = True</param>
        /// <param name="SearchPattern">File pattern to search for</param>
        /// <param name="OverWritePrevious">Option to overwrite previous OutFile if it exists (Default = True)</param>
        /// <param name="OpenAfterWrite">If OutFile path provided, option to open new text file after writing (Default = True)</param>
        /// <returns>Returns string with list of file paths under SearchDir</returns>
        public static string DirPrint(this string SearchDir, string OutFile = "", bool Recurse = true, string SearchPattern = "*.*", bool OverWritePrevious = true, bool OpenAfterWrite = true)
        {
            _AHK ahk = new _AHK();

            return(ahk.DirPrint(SearchDir, OutFile, Recurse, SearchPattern, OverWritePrevious, OpenAfterWrite));
        }