Ejemplo n.º 1
0
 /// <summary>
 /// 初始化文件信息
 /// </summary>
 protected FileInfo( string filePath, byte[] fileBytes, long? fileSize, string fileName ) {
     FilePath = filePath;
     FileName = GetFileName( filePath, fileName );
     Extension = GetExtension( filePath );
     Length = new FileSize( fileSize.SafeValue() );
     if ( fileBytes == null )
         return;
     FileBytes = fileBytes;
     Length = new FileSize( fileBytes.Length );
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 初始化文件信息
 /// </summary>
 protected FileInfo(string filePath, byte[] fileBytes, long?fileSize, string fileName)
 {
     FilePath  = filePath;
     FileName  = GetFileName(filePath, fileName);
     Extension = GetExtension(filePath);
     Length    = new FileSize(fileSize.SafeValue());
     if (fileBytes == null)
     {
         return;
     }
     FileBytes = fileBytes;
     Length    = new FileSize(fileBytes.Length);
 }