Wait for file to be freed by process
How do I wait for the File to be Free so that ss.Save() can overwrite it with a new one. If I run this twice close together(ish) I get a generic GDI+ error. ///<summary> /// Grabs a screen shot of the App and saves it to the C drive in jpg ///</summary> private static String GetDesktopImage(DevExpress.XtraEditors.XtraForm whichForm) { Rectangle bounds = whichForm.Bounds; // This solves my problem but creates a clutter issue //var timeStamp = DateTime.Now.ToString("ddd-MMM-dd-yyyy-hh-mm-ss"); //var fileName = "C:\\HelpMe" + timeStamp + ".jpg"; var fileName = "C:\\HelpMe.jpg"; File.Create