StatusMessageTextWriter Property

DotNetZip

Ionic Zip Library v1.9.1.6 StatusMessageTextWriter Property
ReferenceIonic.ZipZipFileStatusMessageTextWriter
Gets or sets the TextWriter to which status messages are delivered for the instance.
Declaration Syntax
C# Visual Basic Visual C++
public TextWriter StatusMessageTextWriter { get; set; }
Public Property StatusMessageTextWriter As TextWriter
	Get
	Set
public:
property TextWriter^ StatusMessageTextWriter {
	TextWriter^ get ();
	void set (TextWriter^ value);
}
Remarks
If the TextWriter is set to a non-null value, then verbose output is sent to the TextWriter during Add, Read, Save and Extract operations. Typically, console applications might use Console.Out and graphical or headless applications might use a System.IO.StringWriter. The output of this is suitable for viewing by humans.
Examples

In this example, a console application instantiates a ZipFile, then sets the StatusMessageTextWriter to Console.Out. At that point, all verbose status messages for that ZipFile are sent to the console.

CopyC#
using (ZipFile zip= ZipFile.Read(FilePath))
{
  zip.StatusMessageTextWriter= System.Console.Out;
  // messages are sent to the console during extraction
  zip.ExtractAll();
}
CopyVB.NET
Using zip As ZipFile = ZipFile.Read(FilePath)
  zip.StatusMessageTextWriter= System.Console.Out
  'Status Messages will be sent to the console during extraction
  zip.ExtractAll()
End Using

In this example, a Windows Forms application instantiates a ZipFile, then sets the StatusMessageTextWriter to a StringWriter. At that point, all verbose status messages for that ZipFile are sent to the StringWriter.

CopyC#
var sw = new System.IO.StringWriter();
using (ZipFile zip= ZipFile.Read(FilePath))
{
  zip.StatusMessageTextWriter= sw;
  zip.ExtractAll();
}
Console.WriteLine("{0}", sw.ToString());
CopyVB.NET
Dim sw as New System.IO.StringWriter
Using zip As ZipFile = ZipFile.Read(FilePath)
  zip.StatusMessageTextWriter= sw
  zip.ExtractAll()
End Using
'Status Messages are now available in sw

Assembly: Ionic.Zip (Module: Ionic.Zip) Version: 1.9.1.8 (1.9.1.8)