Ask a Question related to ASP.NET General, Design and Development.
-
Earl Teigrob #1
Newly Created Image Not Always Found by Following Code
I am having a problem where the bitmap image that I just created and saved
to disk can not be found but the code in another area of the program. When I
reattempt to access the same image, it always works becuase the image has
been fully saved to that drive by that time. Is there a way to make sure
that a newly created bitmap image is phisically saved to disk before it is
accessed?
The code that creates that new bitmap image is as follows
Bitmap ImageOut = new Bitmap(NewImageWidth, NewImageHeight);
//other code
ImageOut.Save(NewImagePhisicalPath, FileFormat);
The code that tries to access the new bitmap looks like this
System.Drawing.Image image =
System.Drawing.Image.FromFile(NewImagePhisicalPath );
But this fails some of the time with a file not found execption.
I can add the follow code that should fix this but I am wondering if there
is a better way to flush the file to the disk before accessing it?
while (!(File.Exists(NewImagePhisicalPath)))
{
//do nothing
}
string ImageName =
System.Web.HttpContext.Current.Request.MapPath(Pho toImageButton.ImageUrl);
Earl Teigrob Guest
-
#40300 [NEW]: Calling a function on a newly created object doesn't work
From: finalvoid at gmail dot com Operating system: Windows XP PHP version: 5.2.0 PHP Bug Type: Class/Object related Bug... -
Page view issues with newly created links
I just finished creating links on each page of a 200 page document, allowing users to easily jump from section to section. When creating the links I... -
Permissions for newly created files by FSO
Hi there, I'm struggling with this problem: in a website I developed, XML files are created by users of the site to describe. The creation is... -
Permissions wrong on newly created file
I have two systems unrelated to each other with the same problem. Both systems are running 5.0.5 and have RS505A patch loaded. At the beginning of... -
allowing newly created user accounts access to admin account software
I've just created 2 new user accounts with limited access using windows XP. THe only problem is that they dont have access to software (eg....



Reply With Quote

