The packager class can be used to package up session files synchronously or asynchronously and send them via email or just store the results to a single, compact file without any user interface. If you want to provide a user interface, see the PackagerDialog class which provides a tunable wizard that wraps this class.
When creating a package of sessions, the packager needs to know:
Asynchronous Usage
The packager can function asynchronously by using the methods that end with Async. To get result information for asynchronous operations you need to subscribe to the EndSession event.
Sending the Active Session
When you specify Session Criteria that includes the ActiveSession several unique things happen.
//Send an email with all of the information about the current application we haven't sent before. using(Packager packager = new Packager()) { packager.SendEmail(SessionCriteria.NewSessions, true, null); }
//Send a file with all of the information about the current application we haven't sent before. using (Packager packager = new Packager()) { //the file name will automatically have the appropriate extension added, so it is specified //below without any file extension. Typically you will want to generate a unique, temporary //file name to store the data as instead of using a fixed file name. packager.SendToFile(SessionCriteria.NewSessions, true, "C:\YourAppSessionData"); }
System.Object
Gibraltar.Agent.Packager
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2