My problem is that this try
fails (resulting in the catch) on only one computer, even using the same user account. It runs fine and saves screenshots from every other computer that uses the program.
Also, manually saving a file (through explorer) into the directory works.
try
{
Bitmap screenShot = new Bitmap(screenWidth, screenHeight);
Graphics gfx = Graphics.FromImage((Image)screenShot);
gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
imageSavePath = @"\\navy\data\Docs\PRE\LogSite\Screenshots\" + DateTime.Now.ToString().Replace('/', '-').Replace(':', '-') + ".png";
screenShot.Save(imageSavePath, ImageFormat.Jpeg);
}
catch (Exception e)
{
MessageBox.Show("Error saving screenshot\n\n" + e.ToString());
}
This is the error:
EDIT: The exe is running from a network drive