/// <summary>
        /// 查找图片
        /// </summary>
        /// <param name="gl_Barcode"></param>
        public List <string> FindImage(string gl_Barcode)
        {
            UInt32        i;
            const int     bufsize = 260;
            StringBuilder buf     = new StringBuilder(bufsize);
            List <string> paths   = new List <string>();

            // set the search
            Everything_SetSearch(gl_Barcode);
            // request name and size
            Everything_SetRequestFlags(EVERYTHING_REQUEST_FILE_NAME | EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_DATE_MODIFIED);

            Everything_SetSort(13);
            // execute the query
            SearchFiles.Everything_Query(true);
            // loop through the results, adding each result to the listbox.
            for (i = 0; i < Everything_GetNumResults(); i++)
            {
                long date_modified;
                long size;
                Everything_GetResultFullPathName(i, buf, bufsize);
                Everything_GetResultSize(i, out size);
                paths.Add(buf.ToString());
            }
            return(paths);
        }
Exemple #2
0
        /// <summary>
        /// 查找csv文件
        /// </summary>
        /// <returns></returns>
        public List <string> FindCSVByDate()
        {
            UInt32        i;
            const int     bufsize = 260;
            StringBuilder buf     = new StringBuilder(bufsize);
            List <string> paths   = new List <string>();

            string date = DateTime.Now.ToString("yyyyMMdd");

            SearchFiles.Everything_SetSearch(date + "*.csv");
            // request name and size
            SearchFiles.Everything_SetRequestFlags(SearchFiles.EVERYTHING_REQUEST_FILE_NAME | SearchFiles.EVERYTHING_REQUEST_PATH | SearchFiles.EVERYTHING_REQUEST_DATE_MODIFIED);

            SearchFiles.Everything_SetSort(13);
            // execute the query
            SearchFiles.Everything_Query(true);
            // loop through the results, adding each result to the listbox.
            for (i = 0; i < SearchFiles.Everything_GetNumResults(); i++)
            {
                long date_modified;
                long size;
                SearchFiles.Everything_GetResultDateModified(i, out date_modified);
                SearchFiles.Everything_GetResultFullPathName(i, buf, bufsize);
                SearchFiles.Everything_GetResultSize(i, out size);
                paths.Add(buf.ToString());
            }
            return(paths);
        }