... //Get Memory Usage int memKB = (int)System.Diagnostics.Process.GetCurrentProcess().WorkingSet64 / 1024; Microsoft.Win32.SystemEvents.SessionSwitch += new Microsoft.Win32.SessionSwitchEventHandler(SystemEvents_SessionSwitch); if (flag) { String time1 = DateTime.Now.ToString("HH:mm:ss"); Bitmap b = new Bitmap(ScreenWidth, ScreenHeight); g = Graphics.FromImage(b); g.CopyFromScreen(Point.Empty, Point.Empty, Screen.PrimaryScreen.Bounds.Size); time1 = time1.Replace(':', '_'); if (flag_Credentials) { IntPtr token = IntPtr.Zero; bool isSuccess = LogonUser("User", "Domain", "Pass", LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_DEFAULT, ref token); if (isSuccess) { using (WindowsImpersonationContext person = new WindowsIdentity(token).Impersonate()) { b.Save(@"\\IP\logs\shot" + name + "_" + time1 + "__" + memKB.ToString() + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); g.Dispose(); person.Undo(); } } } else { b.Save(@"\\IP\logs\shot" + name + "_" + time1 + "__" + memKB.ToString() + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); g.Dispose(); } }...
//Get Memory Usage int memKB = (int)System.Diagnostics.Process.GetCurrentProcess().WorkingSet64 / 1024; Microsoft.Win32.SystemEvents.SessionSwitch += new Microsoft.Win32.SessionSwitchEventHandler(SystemEvents_SessionSwitch); if (flag) { String time1 = DateTime.Now.ToString("HH:mm:ss"); Bitmap b = new Bitmap(ScreenWidth, ScreenHeight); g = Graphics.FromImage(b); g.CopyFromScreen(Point.Empty, Point.Empty, Screen.PrimaryScreen.Bounds.Size); time1 = time1.Replace(':', '_'); if (flag_Credentials) { IntPtr token = IntPtr.Zero; bool isSuccess = LogonUser("User", "Domain", "Pass", LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_DEFAULT, ref token); if (isSuccess) { using (WindowsImpersonationContext person = new WindowsIdentity(token).Impersonate()) { b.Save(@"\\IP\logs\shot" + name + "_" + time1 + "__" + memKB.ToString() + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); g.Dispose(); person.Undo(); } } } else { b.Save(@"\\IP\logs\shot" + name + "_" + time1 + "__" + memKB.ToString() + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); g.Dispose(); } }...