-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrintScreen.cs
More file actions
46 lines (37 loc) · 1.6 KB
/
PrintScreen.cs
File metadata and controls
46 lines (37 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
public static void PrintScreen(string _stringMessage, Boolean FULLSCREEN = false, Boolean FAIL = false)
{
string stringPath = "YOUR PATH"
int _intFAIL;
Thread.Sleep(2000);
if ((FULLSCREEN == false))
{
Keyboard.SendKeys("{PrintScreen}", ModifierKeys.Alt);
//SendKeys.SendWait("{PRTSC 2}");
}
else
{
Keyboard.SendKeys("{PrintScreen}", ModifierKeys.None);
//SendKeys.SendWait("{PRTSC}");
}
DateTime x = DateTime.Now;
string date = x.ToString().Replace("/", "").Replace(":", "").Replace(" ", "_") + ".jpg";
Boolean _booleanSalvedPrint = false;
while (_booleanSalvedPrint == false)
{
Clipboard.GetImage().Save(stringPath + date);
_booleanSalvedPrint = true;
}
Clipboard.Clear();
if (FAIL == true)
{
_intFAIL = 1;
_stringMessage = "FAIL - " + _stringMessage;
}
else
{
_intFAIL = 0;
}
dateAccess dateAccessBancoDadosDB = PublicFunctions.OpenDB(Values);
dateAccessBancoDadosDB.Execute("INSERT INTO ResultExecution(IDScreen,Scenario,SCREEN,DESCRIPTION,PathPRINT,FAIL)" +
"VALUES ('" + Values.intIDExecution + "','" + Values.stringTableCase + "','" + Values.stringTableName + "','" + _stringMessage + "','" + Values.stringPath + date + "','" + _intFAIL + "')");
}