Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Rename Files before UnzippingDownload: Chilkat .NET Assemblies How to rename files before unzipping. The .zip is opened, the filenames are updated (in memory) so that when the .zip is unzipped, the filenames are different. The original .zip is unmodified. ' Dim zipObj As New Chilkat.Zip zipObj.UnlockComponent("Anything for 30-day trial") ' Open a zip archive containing: ' inv.dbf ' cust.dbf ' rpt.dbf ' test.xml ' junk.txt Dim success As Boolean success = zipObj.OpenZip("testData.zip") If (Not success) Then MessageBox.Show(zipObj.LastErrorText) Exit Sub End If ' Loop over the entries and rename all files ending in .dbf: Dim n As Integer Dim i As Integer Dim entry As Chilkat.ZipEntry n = zipObj.NumEntries For i = 0 To n - 1 entry = zipObj.GetEntryByIndex(i) If (entry.FileName.EndsWith(".dbf")) Then entry.FileName = entry.FileName.Replace(".dbf", "01.dbf") End If Next ' Now unzip all .dbf files: n = zipObj.UnzipMatching("unzipDir", "*.dbf", False) If (n < 0) Then MsgBox(zipObj.LastErrorText) Else MsgBox(n.ToString() & " files unzipped!") End If ' These files are created: cust01.dbf, rpt01.dbf, inv01.dbf |
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.