I am using Sharpzip to zip an Excel file with password protected, based on the following codes. How can I remove the path stored in the ZIP file ?
=========================================================================================
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strZip As String = Server.MapPath("test_folder/ttzip.zip")
Dim strText As String = Server.MapPath("cs3.xls")
Dim ZipOut As New ZipOutputStream(File.Create(strZip))
ZipOut.SetLevel(1)
ZipOut.Password = "123456"
Dim entry As New ZipEntry(strText)
ZipOut.PutNextEntry(entry)
Dim fs As FileStream
fs = New FileStream(strText, FileMode.Open)
Dim bytes(CType(fs.Length, Integer)) As Byte
fs.Read(bytes, 0, CInt(fs.Length))
ZipOut.Write(bytes, 0, CInt(fs.Length))
fs.Close()
ZipOut.Finish()
ZipOut.Close()
End Sub
=========================================================================================
Thank you very much.