Exemple #1
0
        /// <summary>
        /// 根据路径获取文件信息,并转换为model
        /// </summary>
        /// <param name="filePath"></param>
        /// <returns></returns>
        public static Files GetFileModelByFilePath(string filePath)
        {
            Files f = new Files();

            f.CFullName         = filePath;
            f.CDir              = System.IO.Path.GetDirectoryName(filePath);
            f.CFileName         = FileIOHelper.GetFileName(filePath);
            f.CExtention        = FileIOHelper.GetExtension(filePath);
            f.IFileLength       = FileIOHelper.GetFileSize(filePath);
            f.TCreateTime       = System.IO.File.GetCreationTime(filePath);
            f.TLastUpdateTime   = System.IO.File.GetLastWriteTime(filePath);
            f.IStatus           = 0;
            f.TSysCheckDateTime = System.DateTime.Now;
            f.CRemark           = "";
            f.TKeyWords         = "";

            return(f);
        }