Click here to Skip to main content
15,892,674 members
Home / Discussions / C#
   

C#

 
GeneralDATABASE change notifycation Pin
Rhonke26-Mar-04 10:51
Rhonke26-Mar-04 10:51 
GeneralRe: DATABASE change notifycation Pin
Heath Stewart26-Mar-04 11:21
protectorHeath Stewart26-Mar-04 11:21 
GeneralDotNet Remoting------------->Urgent Pin
munishk26-Mar-04 10:46
munishk26-Mar-04 10:46 
GeneralRe: DotNet Remoting------------->Urgent Pin
partyganger26-Mar-04 10:58
partyganger26-Mar-04 10:58 
GeneralRe: DotNet Remoting------------->Urgent Pin
Judah Gabriel Himango26-Mar-04 11:15
sponsorJudah Gabriel Himango26-Mar-04 11:15 
GeneralRe: DotNet Remoting------------->Urgent Pin
munishk28-Mar-04 13:54
munishk28-Mar-04 13:54 
GeneralRe: DotNet Remoting------------->Urgent Pin
Heath Stewart26-Mar-04 11:18
protectorHeath Stewart26-Mar-04 11:18 
Generalzipping files in C# Pin
elena1234526-Mar-04 10:13
elena1234526-Mar-04 10:13 
Hi,

What library do you use to zip up files? I am using java.util.zip and it's giving me some problems.
Everything works fine if WInZip is installed. However if you uninstall WinZip and it uses the Windows default compresser things don't work so well:
the zip file is created but it's empty.
Does anyone know a solution to this problem?

Thanks,

Elena

Here is my code:
<br />
ZipOutputStream           m_zipstream; <br />
string filepath = @"C:\Elena\Junk\test\a.txt";<br />
m_zipstream = new ZipOutputStream( new java.io.FileOutputStream( @"C:\Elena\Junk\test\zip.zip" ) ); <br />
ZipEntry currententry = new ZipEntry(filepath);<br />
currententry.setMethod(ZipEntry.DEFLATED);<br />
<br />
m_zipstream.putNextEntry(currententry);<br />
<br />
try<br />
{                    <br />
  java.io.FileInputStream current = new java.io.FileInputStream(filepath);                    <br />
  try<br />
  {<br />
    sbyte[] buffer = new sbyte[8192];<br />
    int     buffercount;<br />
    while ((buffercount = current.read(buffer, 0, buffer.Length)) > 0)<br />
      m_zipstream.write(buffer, 0, buffercount);<br />
  }<br />
  finally { current.close(); }<br />
}<br />
finally { m_zipstream.closeEntry(); }<br />
m_zipstream.close(); <br />
m_zipstream = null;<br />



Elena
GeneralRe: zipping files in C# Pin
Judah Gabriel Himango26-Mar-04 10:20
sponsorJudah Gabriel Himango26-Mar-04 10:20 
GeneralBuild and revision number Pin
blackthunder00126-Mar-04 9:15
blackthunder00126-Mar-04 9:15 
GeneralRe: Build and revision number Pin
partyganger26-Mar-04 9:42
partyganger26-Mar-04 9:42 
GeneralCode-Completion Pin
Peter Nirschl26-Mar-04 8:08
Peter Nirschl26-Mar-04 8:08 
GeneralRe: Code-Completion Pin
Heath Stewart26-Mar-04 8:18
protectorHeath Stewart26-Mar-04 8:18 
GeneralRe: Code-Completion Pin
Peter Nirschl27-Mar-04 3:05
Peter Nirschl27-Mar-04 3:05 
GeneralRe: Code-Completion Pin
Heath Stewart27-Mar-04 5:52
protectorHeath Stewart27-Mar-04 5:52 
GeneralRe: Code-Completion Pin
leppie27-Mar-04 5:41
leppie27-Mar-04 5:41 
GeneralRe: Code-Completion Pin
Peter Nirschl27-Mar-04 20:56
Peter Nirschl27-Mar-04 20:56 
GeneralRe: Code-Completion Pin
leppie27-Mar-04 21:51
leppie27-Mar-04 21:51 
GeneralRe: Code-Completion Pin
Peter Nirschl28-Mar-04 5:07
Peter Nirschl28-Mar-04 5:07 
GeneralRe: Code-Completion Pin
leppie28-Mar-04 7:29
leppie28-Mar-04 7:29 
GeneralWindows Services Installation Pin
opopov26-Mar-04 7:32
opopov26-Mar-04 7:32 
GeneralRe: Windows Services Installation Pin
Heath Stewart26-Mar-04 7:46
protectorHeath Stewart26-Mar-04 7:46 
GeneralRe: Windows Services Installation Pin
opopov26-Mar-04 10:10
opopov26-Mar-04 10:10 
GeneralRe: Windows Services Installation Pin
Heath Stewart26-Mar-04 11:16
protectorHeath Stewart26-Mar-04 11:16 
GeneralRe: Windows Services Installation Pin
opopov26-Mar-04 22:29
opopov26-Mar-04 22:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.