C# 클래스 System.IO.Compression.ZipStorer

Unique class for compression/decompression file. Represents a Zip file.
상속: IDisposable
파일 보기 프로젝트 열기: remobjects/train 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
EncodeUTF8 bool
ForceDeflating bool

공개 메소드들

메소드 설명
AddFile ( Compression _method, string _pathname, string _filenameInZip, string _comment, ushort access = 0x8100 ) : void

Add full contents of a file into the Zip storage

AddStream ( Compression _method, string _filenameInZip, System.Stream _source, System.DateTime _modTime, string _comment, ushort access = 0x8100 ) : void

Add full contents of a stream into the Zip storage

Close ( ) : void

Updates central directory (if pertinent) and close the Zip storage

This is a required step, unless automatic dispose is used

Create ( System.Stream _stream, string _comment ) : ZipStorer

Method to create a new zip storage in a stream

Create ( string _filename, string _comment ) : ZipStorer

Method to create a new storage file

Dispose ( ) : void

Closes the Zip file stream

ExtractFile ( ZipFileEntry _zfe, System.Stream _stream ) : bool

Copy the contents of a stored file into an opened stream

Unique compression methods are Store and Deflate

ExtractFile ( ZipFileEntry _zfe, string _filename ) : bool

Copy the contents of a stored file into a physical file

Unique compression methods are Store and Deflate

Open ( System.Stream _stream, FileAccess _access ) : ZipStorer

Method to open an existing storage from stream

Open ( string _filename, FileAccess _access ) : ZipStorer

Method to open an existing storage file

ReadCentralDir ( ) : List

Read all the file records in the central directory

RemoveEntries ( ZipStorer &_zip, List _zfes ) : bool

Removes one of many files in storage. It creates a new Zip file.

This method only works for storage of type FileStream

비공개 메소드들

메소드 설명
DateTimeToDosTime ( System.DateTime _dt ) : uint
DosTimeToDateTime ( uint _dt ) : System.DateTime
GetFileOffset ( uint _headerOffset ) : uint
NormalizedFilename ( string _filename ) : string
ReadFileInfo ( ) : bool
Store ( ZipFileEntry &_zfe, System.Stream _source ) : void
UpdateCrcAndSizes ( ZipFileEntry &_zfe ) : void
WriteCentralDirRecord ( ZipFileEntry _zfe ) : void
WriteEndRecord ( uint _size, uint _offset ) : void
WriteLocalHeader ( ZipFileEntry &_zfe ) : void
ZipStorer ( ) : System.Collections.Generic

메소드 상세

AddFile() 공개 메소드

Add full contents of a file into the Zip storage
public AddFile ( Compression _method, string _pathname, string _filenameInZip, string _comment, ushort access = 0x8100 ) : void
_method Compression Compression method
_pathname string Full path of file to add to Zip storage
_filenameInZip string Filename and path as desired in Zip directory
_comment string Comment for stored file
access ushort
리턴 void

AddStream() 공개 메소드

Add full contents of a stream into the Zip storage
public AddStream ( Compression _method, string _filenameInZip, System.Stream _source, System.DateTime _modTime, string _comment, ushort access = 0x8100 ) : void
_method Compression Compression method
_filenameInZip string Filename and path as desired in Zip directory
_source System.Stream Stream object containing the data to store in Zip
_modTime System.DateTime Modification time of the data to store
_comment string Comment for stored file
access ushort
리턴 void

Close() 공개 메소드

Updates central directory (if pertinent) and close the Zip storage
This is a required step, unless automatic dispose is used
public Close ( ) : void
리턴 void

Create() 공개 정적인 메소드

Method to create a new zip storage in a stream
public static Create ( System.Stream _stream, string _comment ) : ZipStorer
_stream System.Stream
_comment string
리턴 ZipStorer

Create() 공개 정적인 메소드

Method to create a new storage file
public static Create ( string _filename, string _comment ) : ZipStorer
_filename string Full path of Zip file to create
_comment string General comment for Zip file
리턴 ZipStorer

Dispose() 공개 메소드

Closes the Zip file stream
public Dispose ( ) : void
리턴 void

ExtractFile() 공개 메소드

Copy the contents of a stored file into an opened stream
Unique compression methods are Store and Deflate
public ExtractFile ( ZipFileEntry _zfe, System.Stream _stream ) : bool
_zfe ZipFileEntry Entry information of file to extract
_stream System.Stream Stream to store the uncompressed data
리턴 bool

ExtractFile() 공개 메소드

Copy the contents of a stored file into a physical file
Unique compression methods are Store and Deflate
public ExtractFile ( ZipFileEntry _zfe, string _filename ) : bool
_zfe ZipFileEntry Entry information of file to extract
_filename string Name of file to store uncompressed data
리턴 bool

Open() 공개 정적인 메소드

Method to open an existing storage from stream
public static Open ( System.Stream _stream, FileAccess _access ) : ZipStorer
_stream System.Stream Already opened stream with zip contents
_access FileAccess File access mode for stream operations
리턴 ZipStorer

Open() 공개 정적인 메소드

Method to open an existing storage file
public static Open ( string _filename, FileAccess _access ) : ZipStorer
_filename string Full path of Zip file to open
_access FileAccess File access mode as used in FileStream constructor
리턴 ZipStorer

ReadCentralDir() 공개 메소드

Read all the file records in the central directory
public ReadCentralDir ( ) : List
리턴 List

RemoveEntries() 공개 정적인 메소드

Removes one of many files in storage. It creates a new Zip file.
This method only works for storage of type FileStream
public static RemoveEntries ( ZipStorer &_zip, List _zfes ) : bool
_zip ZipStorer Reference to the current Zip object
_zfes List List of Entries to remove from storage
리턴 bool

프로퍼티 상세

EncodeUTF8 공개적으로 프로퍼티

True if UTF8 encoding for filename and comments, false if default (CP 437)
public bool EncodeUTF8
리턴 bool

ForceDeflating 공개적으로 프로퍼티

Force deflate algotithm even if it inflates the stored file. Off by default.
public bool ForceDeflating
리턴 bool