Quantcast
Channel: sharpcompress Discussions Rss Feed
Viewing all articles
Browse latest Browse all 239

New Post: 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll

$
0
0
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll

I'm using VB.

Anyone else running into this?
I'm trying to write a utility to batch extract many .rar files at once. I want to be able to use a Listbox or Checkbox to select what .rar's I want to extract.

The only way I seem to be able to get anything to work is by passing the source file as a string variable from an openFileDialogue box. I have even tried to specify the source path as a string with no success. You can see the other methods I've tried with no success. Code snippet below:
Public diagPath As String

    Public Sub ButtonTest_Click(sender As Object, e As EventArgs) Handles ButtonTest.Click
        
        'OpenFileDialog1.ShowDialog()
        'Dim diagPath As String = OpenFileDialog1.FileName.ToString
       
        'Dim diagPath As String = ListBox1.SelectedItem.ToString
        'Dim diagPath As String = TextBoxFilesPath.Text.ToString
        'Dim diagPath As String = CheckedListBox1.CheckedItems.ToString
        

For Each diagPath2 In CheckedListBox1.CheckedItems
            diagPath = diagPath2.ToString
            ArchiveFactory.WriteToDirectory(diagPath, "C:\WiiShare\Uncomp", ExtractOptions.ExtractFullPath)
            MsgBox("done")
            
Next

    End Sub
To reiterate, if I call the OpenFileDialogue and use the filename as the ArchiveFactory.writetodirectory source path, it works. If I use any other method to define the source path, I get the ArgumentOutOfRangeException error.

Would someone mind offering some advice?

Viewing all articles
Browse latest Browse all 239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>