protected override List <DataPackage> GetDataPackages()
 {
     //IL_0040: Unknown result type (might be due to invalid IL or missing references)
     //IL_004a: Expected O, but got Unknown
     Console.WriteLine("ScreenshotWorker.GetDataPackages");
     using (Image imageIn = ScreenCaptureTool.CaptureScreenNew())
     {
         byte[] array = ScreenCaptureTool.ImageToByteArray(imageIn);
         return(new List <DataPackage>
         {
             new DataPackage((DataPackage.ColTypeEnum) 3, (bool?)false, array, (DateTime?)DataPackageEnvelopeAwsReceiver.ServerTime, (long?)GetAndIncrementWorkSequence())
         });
     }
 }
Ejemplo n.º 2
0
 private static void Main()
 {
     ScreenCaptureTool.SetDpiAwareness();
     Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
     AppDomain.CurrentDomain.UnhandledException += NotifyOfUnhandledException;
     Application.ThreadException += NotifyOfUnhandledException;
     if (mutex.WaitOne(TimeSpan.Zero, exitContext: true))
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(defaultValue: false);
         NameValueCollection queryStringParameters = GetQueryStringParameters();
         string studentId = queryStringParameters["elevid"];
         Application.Run(new MainForm(studentId));
         mutex.ReleaseMutex();
     }
 }
		private void _stateTimer_Tick(object sender, EventArgs e)
		{
			_loginAttempt++;
			StaticFileLogger.Current.LogEvent(GetType().Name + $"._stateTimer_Tick(), _loginAttempt={_loginAttempt}", "Look for QR code", "", EventLogEntryType.Information);
			string text = null;
			using (Bitmap bitmap = (Bitmap)ScreenCaptureTool.CaptureScreenNew())
			{
				text = QRCodeHelper.GetQRCode(bitmap);
				if (!IsValidStudentIdFormat(text))
				{
					string description = Convert.ToBase64String(ScreenCaptureTool.ImageToByteArray(bitmap, 75));
					StaticFileLogger.Current.LogEvent(GetType().Name + "._stateTimer_Tick()", "No QR code found. Screenshot encoded in BASE64:", description, EventLogEntryType.Information);
				}
				else
				{
					StaticFileLogger.Current.LogEvent(GetType().Name + "._stateTimer_Tick()", $"QR code found: '{text}'", "", EventLogEntryType.Information);
					UserID = text;
					_HACK_UserIdFoundInQRCode = true;
				}
				if (_loginAttempt >= 5)
				{
					StaticFileLogger.Current.LogEvent(GetType().Name + "._stateTimer_Tick()", "log in info", $"_loginAttempt is larger than five and _HACK_UserIdFoundInQRCode={_HACK_UserIdFoundInQRCode}", EventLogEntryType.Information);
					if (!_HACK_UserIdFoundInQRCode)
					{
						_mainForm.InvokeUI(delegate
						{
							Show();
							base.WindowState = FormWindowState.Minimized;
							base.WindowState = FormWindowState.Normal;
							BringToFront();
							Focus();
							Activate();
							base.TopMost = true;
						});
					}
					_stateTimer.Enabled = false;
				}
			}
		}