Page 3 of 3

Re: Simple WinZip Program

Posted: Sat Jul 30, 2011 3:14 pm
by Napster1488
Hey Dude,
i just made a small DLL File that u can use in VB.NET to Extract RAR Files using UnRAR.
it contains two Functions in the moment "ExtractToCurrentDirectory and ExtractRAR"

How to Use:

Import to get Access to the Functions
Code: Select all
Imports UnRAR.UnRAR
Dim Variable to use it
Code: Select all
Dim rar as UnRAR.UnRAR = New UnRAR.UnRAR
First u need the Function SetPath to set the Path where the UnRAR.exe is stored
Code: Select all
rar.SetPath("C:/UnRAR.exe")
The two Extract Functions doesnt need Explantations.

Here is the Source Code from the UnRAR Lib
Code: Select all
Public Class UnRAR
    Dim Path As String

    Public Sub SetPath(ByVal UnRARpath As String)
            Path = UnRARpath
    End Sub

    Public Function ExtractToCurrentDirectory(ByVal File As String) As String
        Shell("cmd /k" & Path & " e " & File, AppWinStyle.Hide, True)
    End Function

    Public Function ExtractRAR(ByVal File As String, ByVal ExtractDir As String) As String
        Shell("cmd /k" & Path & " x " & File & " " & ExtractDir, AppWinStyle.Hide, True)
    End Function
End Class
Normally i wanted to use more Advanced Way with Process,the same Way how i do it with FFmpeg Command Line tool but it wasnt working with UnRAR,so i had to use this Way.

Greetz Napster

Re: Simple WinZip Program

Posted: Sun Jul 31, 2011 12:20 pm
by gille
I will test it later, thanks!

Re: Simple WinZip Program

Posted: Sun Jul 31, 2011 3:16 pm
by Napster1488
gille wrote:
I will test it later, thanks!
No prob.

Re: Simple WinZip Program

Posted: Sun Jul 31, 2011 3:32 pm
by Axel
such a small piece of code doesn't require a library to be made. It takes away the portability of the program. And I found out why my version isn't working

Re: Simple WinZip Program

Posted: Thu Aug 11, 2011 9:00 pm
by jackdawkc
I don't think it's cheating, it does what it say's on the tin :)