Creates a new zip file in a stream.
Namespace:
C1.C1Zip
Assembly:
C1.Phone.Zip (in C1.Phone.Zip.dll)
Syntax
C# |
---|
public void Create(
Stream stream
) |
Visual Basic |
---|
Public Sub Create ( _
stream As Stream _
) |
Parameters
- stream
- Type: System.IO..::..Stream
Stream that will contain the new zip file.
Examples
The code below creates a new
C1ZipFile on a memory stream, then adds
several files to it. Finally, the code gets the zipped data out as an array of bytes,
which could be stored in a database for example.
Copy CodeC#
MemoryStream msZip = new MemoryStream();
C1ZipFile zip = new C1ZipFile(msZip, true);
foreach (string f in Directory.GetFiles(@"c:\WINDOWS\Web\Wallpaper"))
{
zip.Entries.Add(f);
}
byte[] zipData = msZip.ToArray(); |
See Also