private void SaveFileInt(object param) { try { ScreenshotInterface.ScreenshotRequest r = (ScreenshotInterface.ScreenshotRequest)param; String file = String.Format(r.FileName, Process.GetCurrentProcess().ProcessName, Process.GetCurrentProcess().StartTime, DateTime.Now); String dir = Path.GetDirectoryName(file); if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } DebugMessage("Saving " + r.Format.ToString() + " in " + file); bitmap.Save(file, GetImageFormat(r.Format)); } catch { DebugMessage("Save failed!"); } }
protected void CheckAuto() { if (Request != null) { if (Request.SetInterval) { if (autoScreenshot) { autoInterval = 0; _lastAutoScreenshotTime = null; autoRequest = null; autoScreenshot = false; Request = null; } else if (Request.Interval > 0) { autoInterval = Request.Interval; autoRequest = Request; autoScreenshot = true; _lastAutoScreenshotTime = DateTime.Now; } } } if (Request == null && autoScreenshot) { if ((DateTime.Now - _lastAutoScreenshotTime.Value).TotalSeconds > autoInterval) { Request = autoRequest; _lastAutoScreenshotTime = DateTime.Now; } } }
protected void CheckAuto() { if (Request != null) { if (Request.SetInterval) { if (autoScreenshot) { autoInterval = 0; _lastAutoScreenshotTime = null; autoRequest = null; autoScreenshot = false; Request = null; } else if (Request.Interval > 0) { autoInterval = Request.Interval; autoRequest = Request; autoScreenshot = true; _lastAutoScreenshotTime = DateTime.Now; } } } if (Request == null && autoScreenshot) { if ((DateTime.Now - _lastAutoScreenshotTime.Value).TotalSeconds > autoInterval) { Request = autoRequest; _lastAutoScreenshotTime = DateTime.Now; } } }