I've got the problem narrowed down, I just don't know how to fix it.
Here is an example code-
Variables for example:
Zip and UnZip subs:Code:Dim Username As String = Environment.UserName Dim AppData As String = "C:\Users\" & Username & "\AppData\Roaming"
Code:Public Sub MyZip(ByVal ContentFolder As String, ByVal CreateZip As String) Using zip As ZipFile = New ZipFile() zip.AddDirectory(ContentFolder) zip.Save(CreateZip) End Using End SubHow I call the subs:Code:Public Sub MyExtract(ByVal ZipToUnpack As String, ByVal UnpackDirectory As String) Using zip As ZipFile = ZipFile.Read(ZipToUnpack) Dim e As ZipEntry For Each e In zip e.Extract(UnpackDirectory, ExtractExistingFileAction.OverwriteSilently) Next End Using End Sub
All this works fine, but the problem is that DotNetZip will not take file locations in this form. I get this weird "FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of "\\.\" in the path." error. If I just put the zip and folder names (instead of locations + names) it works fine but only looks in it's local directory. How do I get it to function as I need it to?Code:MyExtract(AppData & "\test.zip", AppData & "\testdirectory") MyZip(AppData & "\testdirectory", AppData & "\test.zip")




Reply With Quote
