Skip to content

Instantly share code, notes, and snippets.

@thePunderWoman
Created March 27, 2013 15:55
Show Gist options
  • Save thePunderWoman/5255341 to your computer and use it in GitHub Desktop.
Save thePunderWoman/5255341 to your computer and use it in GitHub Desktop.
Image i = null;
int tries = 0;
while (i == null) {
try {
i = Image.FromFile(server.MapPath(file));
} catch {
// image failed to map
}
tries++;
if (tries >= 10) {
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment