This tutorial will use WinRAR as an example to show you how to excute an outside application process by using ASP.NET 2.0 and VB.NET. We will manipulate WinRAR command to compress or extract file. This tutorial will use WinRAR as an example to show you how to excute an outside application process by using ASP.NET 2.0 and C#. We will manipulate WinRAR command to compress or extract file.

At first, you need to import the namespace from Microsoft.Win32 and System.Diagnostics.RegistryKey and Registry class in the namespace Microsoft.Win32.Class RegistryKey represents a key-level node in the Windows registry, which is a registry encapsulation. Class Registry Supplies the base Registrykeys that access values and subkeys in the registry.ProcessStartInfo and Process class in the namespace System. Diagnostics. ProcessStartInfo is used in conjunction with the Process component. When you start a process using the Process class, you have access to process information in addition to that available when attaching to a running process.Process provides access to local and remote processes and enables you to start and stop local system processes.

In order to run the example, please create a file under the directory c:testtest.txt. Run the example and click Zip button you will see a compressed file test.rar will be generated in the c:test .Click UnZip button you will see that the test.rar will be extracted. Button1_Click event is used to zip a file and Button2_Click is used to unzip a file. The following code is:

The front end page looks something like this:

The flow for the code behind page is as follows:

Download Source Files