public static string Printscreen(bool returnStringPath = false)
{
string fileName = "screenshot_" + DateTime.Now.Day + DateTime.Now.Month + DateTime.Now.Year + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + ".png";
ScreenCapture sc = new ScreenCapture();
DirectoryInfo dir = new DirectoryInfo(Log.StartupPath + "\\screenshots\\");
if (!dir.Exists)
dir.Create();
sc.CaptureScreenToFile(Log.StartupPath + "\\screenshots\\" + fileName, ImageFormat.Png);
if (returnStringPath)
return Log.StartupPath + "screenshots\\" + fileName;
else
return "screenshots/" + fileName;
}