Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click ListBox1.Items.Clear() FolderBrowserDialog1.SelectedPath = "C:\" FolderBrowserDialog1.Description = "Select A Directory" ' Show the dialog and if the user chose OK, then the dialog will return a DialogResult of OK ' We can then set our textbox for the Path to the path they selected. If FolderBrowserDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then TextBox1.Text = FolderBrowserDialog1.SelectedPath End If Dim files() As String files = Directory.GetFiles(TextBox1.Text, "*.zip") 'Now we will loop through these files, adding ONLY the filename portion of the file found. 'Directory.GetFiles returns whole paths. Dim file As String For Each file In files ListBox1.Items.Add(Path.GetFileName(file)) Next End Sub
Can I get a file inside a .zip file without unzipping the .zip file?Using Files within a .zip file without having to unzip it
Page 1 of 1
1 Replies - 2675 Views - Last Post: 21 January 2010 - 01:07 PM
#1
Can I get a file inside a .zip file without unzipping the .zip file?
Posted 21 January 2010 - 11:21 AM
I am trying to create an application that will copy files with a "*.1" extension over to another directory and change the file extension to .tif. The problem is that the *.1 files are located within zip files. Is it possible to copy files out of a zip file without having to extract it? The code I have so far is below. I have only gotten to the point to list all *.zip files found in a specific directory in a listbox. I am really looking to list all *.1 files found within all .zip files in a specific directory. Once they are all listed in the listbox, I will then chose a destination directory, copy them to the destination directory and change the files from a .1 extension to a .TIF extension.
Replies To: Can I get a file inside a .zip file without unzipping the .zip file?
#2
Re: Can I get a file inside a .zip file without unzipping the .zip file?
Posted 21 January 2010 - 01:07 PM
I don't know that you can get at the files inside the Zipfile as it doesn't appear VB.net has anything like that built in, but this might help...
http://www.codeguru....ad.php?t=443029
Unzip the files to a temp directory, copy out all *.1 files, then clean up by deleting the temp directory.
Hope that helps...
http://www.codeguru....ad.php?t=443029
Unzip the files to a temp directory, copy out all *.1 files, then clean up by deleting the temp directory.
Hope that helps...
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|