You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.4.1.9 - Screenshots that fail to upload to an SFTP server will try to upload to the same SFTP server in the next capture cycle until the upload is successful.
Copy file name to clipboardExpand all lines: ScreenCapture.cs
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -720,10 +720,14 @@ public Bitmap GetActiveWindowBitmap(int resolutionRatio, bool mouse)
720
720
intwidth=rect.Width-rect.X;
721
721
intheight=rect.Height-rect.Y;
722
722
723
-
_log.WriteDebugMessage($"Attempting to capture active window image using width={width}, height={height}, resolutionRatio={resolutionRatio}, mouse={mouse}");
724
-
725
723
if(width>0&&height>0)
726
724
{
725
+
// We don't need to log this message if the resolution ratio is 0 since if it is 0 then it's most likely a test of the screen capture method.
726
+
if(resolutionRatio>0)
727
+
{
728
+
_log.WriteDebugMessage($"Attempting to capture active window image using width={width}, height={height}, resolutionRatio={resolutionRatio}, mouse={mouse}");
2.4.1.8DeleteScreenshotstriggerusesScreenshotsFolderinsteadofDefaultScreenshotsFolder.SendingatestemailfromEmailSettingslogsanyexceptionerrorandtheSendTestEmailbuttonisenabledagainafteranexceptionhasbeencaught.EmailSettingsformacceptsmultipleemailaddressesinTO, CC, andBCCfieldsusingeither; or , as a separator.
I love the Blade movies and I don't care what anyone says but the music in the "Bloodbath" nightclub scene of the first movie is still cool.\par
7700
7700
The biggest feature implemented in 2.4 was the ability to encrypt and decrypt screenshots. The interface was cleaned up and more user-friendly notes were included. This version introduces the "Auto Adapt" feature for screens so that the position and size of each screen is automatically adjusted based on changes made to the display setup.\par
7701
7701
Here's every change in the 2.4 "Blade" series (starting with the most recent change):\par
7702
-
\cf1\f1\fs19\lang1033 2.4.1.9 Screenshots count is reset when screenshots limit is reached to avoid falling into an infinite loop. New trigger actions Restart Screen Capture, \f2 Delete Screenshots By Cycle Count, and Delete Screenshots From Oldest Capture Cycle\f1 . New command "-restart". \f2 New macro tag "%capturenow%".\f1\par
7702
+
\cf1\f1\fs19\lang1033 2.4.1.9 Screenshots count is reset when screenshots limit is reached to avoid falling into an infinite loop. New trigger actions Restart Screen Capture, \f2 Delete Screenshots By Cycle Count, and Delete Screenshots From Oldest Capture Cycle\f1 . New command "-restart". \f2 New macro tag "%capturenow%".\f1 \f2 Screenshots that fail to upload to an SFTP server will try to upload to the same SFTP server \f1 in the next capture cycle\f2 \f1 until\f2 \f1 the upload is successful.\par
7703
7703
2.4.1.8 \f2 Delete Screenshots trigger uses ScreenshotsFolder instead of DefaultScreenshotsFolder. Sending a test email from Email Settings logs any exception error and the Send Test Email button is enabled again after an exception has been caught. Email Settings form accepts multiple email addresses in TO, CC, and BCC fields using either ; or , as a separator.\f1\par
7704
7704
2.4.1.7 \f2 Hash included in Screenshot Metadata. Additional debug logging has been included in the screen capture methods.\f1\lang9\par
7705
7705
2.4.1.6 $AppDataLocal$ and $AppDataRoaming$ introduced for autoscreen.conf and autoscreen.conf included as part \lang1033 of \f2\lang9 installation so that an installation of the application can run under normal user privileges without needing to run autoscreen.exe as Administrator from "C:\\Program Files" or "C:\\Program Files (x86)" since the data files are being written to the user's local or roaming app data folder\f1\lang1033 (AppData\\Local by default)\f2\lang9 .\par
_log.WriteDebugMessage("Could not establish a connection with the file server");
1121
1126
1127
+
// Add the screenshot filepath and host to a dictionary of failed uploads so we'll attempt to upload the screenshot for that host later.
1128
+
if(!_failedUploads.ContainsKey(screenshot.Path))
1129
+
{
1130
+
_log.WriteDebugMessage($"Screenshot ({screenshot.Path}) has been added to the dictionary of failed uploads because a connection to the file server could not be established at this time so an attempt to retry the upload will occur in the next capture cycle");
1131
+
1132
+
_failedUploads.Add(screenshot.Path,host);
1133
+
}
1134
+
1122
1135
returnfalse;
1123
1136
}
1124
1137
}
1125
1138
1126
1139
// Make sure we are connected to the file server. If we were not connected earlier then a connection request would have been sent prior to this check.
_log.WriteDebugMessage($"Screenshot ({path}) was found in dictionary of failed uploads");
1142
1154
1143
-
returnfalse;
1155
+
// Make sure that the host associated with the path is equal to the host we're currently handling
1156
+
// so we don't accidentally upload the screenshot to the wrong SFTP server just in case the user changes hosts.
1157
+
if(hostAssociatedWithPath.Equals(host))
1158
+
{
1159
+
if(UploadScreenshot(host,path))
1160
+
{
1161
+
_log.WriteDebugMessage($"This screenshot previously failed to upload. It has now been successfully uploaded to {host}");
1162
+
}
1163
+
}
1164
+
else
1165
+
{
1166
+
_log.WriteDebugMessage($"This screenshot previously failed to upload. It could not be uploaded to {host} at the moment because the screenshot is intended for {hostAssociatedWithPath}");
1167
+
}
1168
+
}
1169
+
}
1144
1170
}
1171
+
1172
+
// Upload the screenshot we're currently handling.
// Remove the path from the dictionary of failed uploads if we were successful in uploading the file to the SFTP server.
1210
+
if(_failedUploads.ContainsKey(path))
1211
+
{
1212
+
_log.WriteDebugMessage($"Screenshot ({path}) has been removed from the dictionary of failed uploads because the upload was successful");
1213
+
1214
+
_failedUploads.Remove(path);
1215
+
}
1216
+
}
1217
+
else
1218
+
{
1219
+
_log.WriteDebugMessage("Failed to upload screenshot");
1220
+
1221
+
// Add the screenshot filepath and host to a dictionary of failed uploads so we'll attempt to upload the screenshot later.
1222
+
if(!_failedUploads.ContainsKey(path))
1223
+
{
1224
+
_log.WriteDebugMessage($"Screenshot ({path}) has been added to the dictionary of failed uploads because the upload failed at this time so an attempt to retry the upload will occur in the next capture cycle");
1225
+
1226
+
_failedUploads.Add(path,host);
1227
+
}
1228
+
1229
+
// We can't simply say that the SFTP client is now disconnected so we just need to nullify the SFTP client.
1230
+
_sftpClient=null;
1231
+
1155
1232
returnfalse;
1156
1233
}
1234
+
1235
+
returntrue;
1157
1236
}
1158
1237
1238
+
/// <summary>
1239
+
/// Uploads a screenshot to an SFTP server based on a trigger action type.
1240
+
/// </summary>
1241
+
/// <param name="triggerActionType">The trigger action type to use.</param>
textBoxActionHelp.Text="Delete screenshots from the oldest capture cycle. You can use this action to perform a rolling delete if you also set the Limit (in Setup) and use the Limit Reached condition. Run a screen capture session for a while first to define the required set of cycles and then trigger this action to start doing the rolling delete.";
1002
+
textBoxActionHelp.Text="Delete screenshots from the oldest capture cycle. You can use this action to perform a rolling delete if you also use the After Screenshot Taken condition. Run a screen capture session for a while first to define the required set of cycles and then trigger this action to start doing the rolling delete.";
0 commit comments