Hi Nicholas
Thank you for your reply.
Yes, I was refering to a .zip archive.
On your recommendation I will check out System.IO.Compression namespace.
Regarding the attributes...
What I want to do is to compress a file in the same way as if I was using
Windows Explorer, right-clicked a file, clicked Advanced and then checked the
"Compress contents to save diskspace".
Isn't there really any way to achive this using C#?
Thanks for you time and input.
Wayne
"Nicholas Paldino [.NET/C# MVP]" wrote:
Wayne,
From the documentation for the SetAttributesMethod on the File class:
It is not possible to change the compression status of a File object using
the SetAttributes method.
By a compressed folder, do you mean a zip file? If that is the case,
then take a look at the System.IO.Compression namespace.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Wayne Gore" <Wa*******@discussions.microsoft.comwrote in message
news:C7**********************************@microsof t.com...
Hi
I want to achive 2 things.
First I would like to compress an existing file on my harddrive.
I can easily find out if a file is compressed or not by using
"File.GetAttributes".
But no matter what I do I simply can't set the compressed attribute using
"SetAttributes".
I have no problem setting the attributes "Read-Only", "Archive" or
"Hidden"
using "SetAttributes"!
How can I do this?
Secondly I would like to be able to create a "compressed folder" (as it is
called in Windows Explorer) and copy files and folders into it.
How can I do that?
Regards
Wayne