Example #1
0
        /// <summary>
        /// 获取文件信息
        /// </summary>
        /// <param name="filePath">文件路径</param>
        /// <returns>文件信息</returns>
        public FileInfor GetFileInfor(string filePath)
        {
            FileControl fc  = new FileControl(filePath);
            FileInfor   fif = new FileInfor()
            {
                FileName      = fc.GetFileName(),
                FileExtension = fc.GetExtension(),
                FileMD5       = fc.GetFileMD5(),
                FileSize      = fc.GetFileSize()
            };

            return(fif);
        }
Example #2
0
        public new SocketFileInfor GetFileInfor(string filePath)
        {
            FileControl     fc  = new FileControl(filePath);
            SocketFileInfor sfi = new SocketFileInfor();

            sfi.FileName      = fc.GetFileName();
            sfi.FileExtension = fc.GetExtension();
            sfi.FileMD5       = fc.GetFileMD5();
            sfi.FileSize      = fc.GetFileSize();
            //sfi.SouceIPEndPoint = null;
            //sfi.Tage = null;
            sfi.FileGUID = Guid.NewGuid().ToString("N");

            return(sfi);
        }