|
Hi,
I am looking at a way to do zip compression in C#. Is there any free library that do zip compression as fast as winzip?
Thanks
|
|
|
|
|
|
GZipStream is very limited. If you have multiple files, after you archive them with GzipStream you will end up with a single file which has the same name as the archive.
|
|
|
|
|
May be, but that's the only thing that the .NET framework has to offer.
So, my other suggestion was the LZMA SDK, which is one of the most powerful compression SDKs (isn't written on managed code though, but can be used from managed code).
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Hi Rajesh,
I tried the LZMA, but the compressed file can't be open in Winzip.
Cheers
|
|
|
|
|
|
Hi Giorgi,
I have tried this. It is extremely slow for big files. But will try all other people suggestion tomorrow.
Thanks for your help
|
|
|
|
|
In .NET 3.0 there is also a ZipPackage Class[^].
Is something more than just a zip file (Office 2007 documents are based on it), but can also be used to manage archive files.
As the prevoius answers, I have no idea about its speed compared to WinZip.
|
|
|
|
|
Hi Mirko,
I have tested this class, it is very slow for big files. In fact, SharpZipLib is faster. But thanks though for this info. I have learned something new
Cheers
|
|
|
|
|
|
Yes!! That is exactly what I am looking for. I have to modify the code a little bit to support compression. Thanks Programm3r for your help
|
|
|
|
|
Hello once again. Just found this: DotNetZip[^] looks quite powrfull. Any ideas about speed/compression?
|
|
|
|
|
Works great, very speedy, good compression, good features. Recommended!
|
|
|
|
|
Hello all
i ma trying to learn how to program a windows service application
i had add an event log and a timer that used to write to file
here is the code
protected override void OnStart(string[] args)
{
eventLog1.WriteEntry("In OnStart");
timer1.Start();
}
protected override void OnStop()
{
eventLog1.WriteEntry("In onStop");
timer1.Stop();
}
protected override void OnContinue()
{
eventLog1.WriteEntry("In OnContinue");
timer1.Start();
}
FileStream fs;
StreamWriter sw;
private void timer1_Tick(object sender, EventArgs e)
{
fs = new FileStream(@"C:\tem.txt", FileMode.OpenOrCreate, FileAccess.Write);
sw = new StreamWriter(fs);
sw.BaseStream.Seek(0, SeekOrigin.End);
sw.WriteLine(DateTime.Now.ToString());
sw.Flush();
sw.Close();
}
and i had added an installer to install the windows service, i followed the instructions that is in the MSDN
http://msdn.microsoft.com/en-us/library/zt39148a%28VS.80%29.aspx
first it works and installed but when i tried to run it from the windows management console
it run and ends immediatly and i got a message telling me that some services closed coze it is not doing anything
when i tried to make a new installation package, and reninstall the service, the installation package failed to install the service and give me 2 messages
the first one saying that source of the service is on the local machine
and finally i got a meesage that the installation is interupted and ended not successfuly
plz help to resolve that.....
|
|
|
|
|
Hi,
I think this might help you: Simple Windows Service Example[^]
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
it is most like the same procedures i had did
|
|
|
|
|
|
I use the [System.Timers.Timer] object in my Windows Services: -
System.Timers.Timer t;
void OnStart(string[] args)
{
t = new System.Timers.Timer();
t.Interval = 1000;
t.Elapsed += new System.Timers.ElapsedEventHandler(t_Elapsed);
t.Enabled = true;
}
void t_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
...
}
|
|
|
|
|
Good day
How do i find every occurence of a substring that begin with a specefied set of characters and end with another set of characters eg
string str = "src=test.pgn testing sub src=file.pgn find it"
i want to read strings that start with src and end with .pgn in the above example i want the following strings in an array "src=test.pgn" and src=file.pgn
Thank you
|
|
|
|
|
|
why are regular expressions so difficult to understand???????
|
|
|
|
|
Don't worry, most people hate them too. I rarely use them, and always have to go back to the manual to check things when I need to.
Post what your trying (in a new question) and maybe some reg-ex superhero can help.
http://xkcd.com/208/[^]
Simon
|
|
|
|
|
|
Hi,
I have problem in keeping the selected text highlighted in a richtextbox when the mouse clicked to other control, eg changing font from a list box or clicking on a treeview control. The text is still selected but the the text not highlighted. How can I maintain the text selection highlighted?
Can someone help?
Regards,
WingOnn
|
|
|
|
|
Set the "HideSelection" property on the text box to false.
Simon
|
|
|
|