/// <summary> /// Return # of Files in Download Dir Current UnFinished /// </summary> /// <returns></returns> public int DownloadCount() { if (DownloadRootPath == null) { ahk.MsgBox("Must Define JDownloader Download Root Path First"); return(0); } // Compare Existing Downloading List, see if any finished downloaded and add to finished downloading list if (JDownloadingList != null) { foreach (string file in JDownloadingList) { string actualFile = file.Replace(".part", ""); if (File.Exists(actualFile)) { if (JDownloadedList == null) { JDownloadedList = new List <string>(); } JDownloadedList.Add(actualFile); } } } List <string> downloading = ahk.FileList(DownloadRootPath, "*.part", true, false, true); JDownloadingList = downloading; return(downloading.Count); }
// File Lists /// <summary> /// Returns List<string> of files in directory path /// </summary> /// <param name="DirPath"> </param> /// <param name="SearchPattern"> </param> /// <param name="Recurse"> </param> /// <param name="FileNameOnly"> </param> /// <param name="IncludeExt"> </param> public static List <string> FileList(this string DirPath, string SearchPattern = "*.*", bool Recurse = true, bool FileNameOnly = false, bool IncludeExt = true) { _AHK ahk = new _AHK(); return(ahk.FileList(DirPath, SearchPattern, Recurse, FileNameOnly, IncludeExt)); }