I am trying to use the 7-zip command line utility to unzip a file in a C# program. I am having problems, however, getting it to unzip.
public static void Unzip(DirectoryInfo DirecInfo)
{
if (DirectInfo.Exists)
{
foreach (FileInfo fileInfo in DirecInfo.GetFiles("*.zip"))
{
Process process = new Process();
process.StartInfo.FileName = @"C:\Program Files\7-zip\7z.exe";
process.StartInfo.Arguments = @" e C:\Directory\" + fileInfo.Name + @" -o C:\Directory";
process.Start();
}
}
}
Open in new window