Exemple #1
0
		internal void Add(FileInformation fi)
		{
			List.Add(fi);
		}
Exemple #2
0
		/// <summary>
		/// Provides an ArrayList of FileInformation classes matching the criteria provided in the FileName parameter
		/// </summary>
		/// <param name="FileName">Long pointer to a null-terminated string that specifies a valid directory or path and filename, which can contain wildcard characters (* and ?).</param>
		/// <returns>An array of FileInformation objects</returns>
		public FileList EnumFiles(string FileName)
		{
			CheckConnection();

			FileList fl = null;
			IntPtr hFile = IntPtr.Zero;

			FileInformation fi = new FileInformation();

			hFile = CeFindFirstFile(FileName, fi);

			if(hFile != (IntPtr)INVALID_HANDLE_VALUE)
			{
				fl = new FileList();

				fl.Add(fi);

				fi = new FileInformation();
				while(CeFindNextFile(hFile, fi) != 0)
				{
					fl.Add(fi);
					fi = new FileInformation();
				}

				CeFindClose(hFile);
			}

			return fl;
		}
Exemple #3
0
 internal static extern IntPtr CeFindFirstFile(string lpFileName, ref FileInformation lpFindFileData);
Exemple #4
0
 internal static extern int CeFindNextFile(IntPtr hFindFile, ref FileInformation lpFindFileData);
Exemple #5
0
        /// <summary>
        /// Provides an ArrayList of FileInformation classes matching the criteria provided in the FileName parameter
        /// </summary>
        /// <param name="FileName">Long pointer to a null-terminated string that specifies a valid directory or path and filename, which can contain wildcard characters (* and ?).</param>
        /// <returns>An array of FileInformation objects</returns>
        public List<FileInformation> EnumFiles(string FileName)
        {
            CheckConnection();

            var list = new List<FileInformation>();
            IntPtr hFile = IntPtr.Zero;

            FileInformation fi = new FileInformation();

            hFile = CeFindFirstFile(FileName, ref fi);

            if (hFile != (IntPtr)INVALID_HANDLE_VALUE)
            {
                list.Add(fi);

                fi = new FileInformation();
                while (CeFindNextFile(hFile, ref fi) != 0)
                {
                    list.Add(fi);
                    fi = new FileInformation();
                }

                CeFindClose(hFile);
            }

            return list;
        }