Save Screens As Text Or Images
In This Topic
You can monitor and log the screens accessed by users during a session. This walkthrough shows how to save the screens as text and images.
To save screens as text or images
- In Visual Studio, create a new Console Application project and add references for the following Reflection assemblies. (Depending on your version of Visual Studio, these can be found either on the .NET tab or under Assemblies | Extensions.)Attachmate.Reflection
Attachmate.Reflection.Framework
Attachmate.Reflection.Emulation.IbmHosts (if you're using IBM)
Attachmate.Reflection.Emulation.OpenSystems (if you're using UNIX or OpenVMS)
- Replace all the code in the Program.cs file with the following code for the terminal you are using. This code gets a handle to a running instance of Reflection. If the type of terminal you want to monitor is selected in the workspace, it creates an event handler to save the screens as they are changed.
- Add the following screenNumber variable and event handler to the Program class. The screenNumber variable is used to provide unique names for screen images. The event handler gets all the text displayed on the screen and appends it to a text file. It also captures the screen and saves it as a .png file.
Alternatively, you could save screen images by turning on ScreenHistory and then saving all images before the session is closed.
To test this project
- Open Reflection and then open a session document file.
- In Visual Studio, press F5 to run the project.
- Enter some data and navigate to a few different screens.
- Open the userInputLog.txt log file in your Documents folder and verify that the data you entered was logged in the file.
- Verify that the screen images are saved in your Documents folder as numbered .png files.