Consider this beautiful code.
It create a file of type ZIP folder then copies a file into it:
I'm trying to replicate it in C# but the last COPYHERE is proving difficult to translate... Any idea what COPYHERE really means?
Copy to directory? Copy to file? Copy to h e double hockey sticks?
Thanks!
It create a file of type ZIP folder then copies a file into it:
Code:
Sub NewZip(sPath)
'Create empty Zip File
Dim oFSO, arrHex, sBin, i, Zip
Set oFSO = CreateObject("Scripting.FileSystemObject")
arrHex = Array(80, 75, 5, 6, 0, 0, 0, _
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
For i = 0 To UBound(arrHex)
sBin = sBin & Chr(arrHex(i))
Next
With oFSO.CreateTextFile(sPath, True)
.Write sBin
.Close
End With
End Sub
Sub Zip_File()
Dim oApp As Object
NewZip ("c:\temp\TEST.zip")
Set oApp = CreateObject("Shell.Application")
oApp.Namespace("c:\temp\TEST.zip").CopyHere ("c:\temp\TEST.xls")
Set oApp = Nothing
End Sub
I'm trying to replicate it in C# but the last COPYHERE is proving difficult to translate... Any idea what COPYHERE really means?
Copy to directory? Copy to file? Copy to h e double hockey sticks?
Thanks!