Partilhar via


Compression Application Sample

This sample demonstrates compression capabilities available in the .NET Framework. It builds a Windows Forms application that employs the GZipStream and DeflateStream types to compress and decompress files. The sample also introduces several types that are new in the .NET Framework version 2.0.

For information about using the samples, see the following topics:

To build the sample using the command prompt

  1. Open the Command Prompt window and navigate to one of the language-specific subdirectories under the CompressionSample directory. For information about required settings and the SDK Command Prompt, see How to: Set Sample Settings.

  2. Type msbuild CompressionCS.sln or msbuild CompressionVB.sln, depending on your choice of programming language.

To build the sample using Visual Studio

  1. Open Windows Explorer and navigate to one of the language-specific subdirectories under the CompressionSample directory.

  2. Double-click the icon for the CompressionCS.sln or CompressionVB.sln file, depending on your choice of programming language, to open the file in Visual Studio.

  3. On the Build menu, click Build Solution.

The application will be built in the default \bin or \bin\Debug directory.

To run the sample

  1. Navigate to the directory that contains the new executable, using the command prompt or Windows Explorer.

  2. Type CompressionSample.exe at the command line, or double-click the icon for CompressionSample.exe to launch it from Windows Explorer.

The sample builds a Windows application. You can run it like any Windows application.

See Also

Reference

DeflateStream
GZipStream
MenuStrip
StatusStrip
ToolStrip