ZipFile.ExtractToDirectory(SaveLocation, ExtractLocation)
Private Sub UnRar(ByVal WorkingDirectory As String, ByVal filepath As String) ' Microsoft.Win32 and System.Diagnostics namespaces are imported 'D:\KIS Folder\Educate\EmpowerLearn\PlayList\Files\AssessmentItems\Teachers\a0a88482-0300-423a-bc3e-39a30b281e9d Dim objRegKey As RegistryKey objRegKey = Registry.ClassesRoot.OpenSubKey("WinRAR\Shell\Open\Command") ' Windows 7 Registry entry for WinRAR Open Command Dim obj As Object = objRegKey.GetValue("") Dim objRarPath As String = obj.ToString() objRarPath = objRarPath.Substring(1, objRarPath.Length - 7) objRegKey.Close() Dim objArguments As String ' in the following format ' " X G:\Downloads\samplefile.rar G:\Downloads\sampleextractfolder\" objArguments = " X " & " " & filepath & " " + " " + WorkingDirectory Dim objStartInfo As New ProcessStartInfo() ' Set the UseShellExecute property of StartInfo object to FALSE ' Otherwise the we can get the following error message ' The Process object must have the UseShellExecute property set to false in order to use environment variables. objStartInfo.UseShellExecute = False objStartInfo.FileName = objRarPath objStartInfo.Arguments = objArguments objStartInfo.WindowStyle = ProcessWindowStyle.Hidden objStartInfo.WorkingDirectory = WorkingDirectory & "\" Dim objProcess As New Process() objProcess.StartInfo = objStartInfo objProcess.Start() End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)