KaraokePC/KaraokeConverter/Unzip.cs
2016-02-28 16:31:35 -05:00

30 lines
873 B
C#

using System;
using System.IO;
using ICSharpCode.SharpZipLib.Zip;
namespace KaraokeConverter
{
public class Unzip
{
public static string UnzipMP3GFiles(string zipFilename, string outputPath)
{
string functionReturnValue = null;
functionReturnValue = "";
try
{
var myZip = new FastZip();
myZip.ExtractZip(zipFilename, outputPath, "");
var myDirInfo = new DirectoryInfo(outputPath);
var myFileInfo = myDirInfo.GetFiles("*.cdg", SearchOption.AllDirectories);
if (myFileInfo.Length > 0)
{
functionReturnValue = myFileInfo[0].FullName;
}
}
catch (Exception ex)
{
}
return functionReturnValue;
}
}
}