RAR is proprietary; I would not advise to use it, but — please see below, you can always un-RAR.
Problem 1:
If you really need to detect the event like that, it may mean that your architecture seriously needs rethinking. If you still think you need go this way, the solution is to use the class
System.IO.FileSystemWatcher
:
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx[
^].
It's use can be problematic though; please see these CodeProject articles:
FileSystemWatcher - Pure Chaos (Part 1 of 2)[
^],
FileSystemWatcher - Pure Chaos (Part 2 of 2)[
^].
I would not advise you to get into it but would rather advise to review the architecture, but decide by yourself; I don't know your goals. (That's why this is a good idea to share them first when asking your questions.)
To work with just ZIP, you can use #ziplib:
http://www.icsharpcode.net/opensource/sharpziplib/[
^].
Another option is using SevenZipSharp, a .NET wrapper of the famous 7-Zip:
http://en.wikipedia.org/wiki/7-Zip[
^],
http://sevenzipsharp.codeplex.com/[
^].
7-zip does support ZIP, RAR and a lot more.
Both libraries are open-source.
Problem 2:
It does not seem to make sense. Compression is not related to Past. If your code pastes, you don't need to "track" anything, your call can trigger whatever you want. If you want to capture Paste event, you need to understand what are you pasting; again, it has nothing to do with file compression. Perhaps I did not understand this part, but you certainly did not explain it properly.
—SA