Click here to Skip to main content
16,008,175 members
Home / Discussions / C#
   

C#

 
AnswerRe: WCF Connection Pin
PIEBALDconsult29-Sep-10 3:18
mvePIEBALDconsult29-Sep-10 3:18 
QuestionDraw Tool 2005 Pin
sunitkrishna29-Sep-10 0:34
sunitkrishna29-Sep-10 0:34 
AnswerRe: Draw Tool 2005 Pin
OriginalGriff29-Sep-10 0:45
mveOriginalGriff29-Sep-10 0:45 
QuestionProblem to remove temporary image files once used Pin
VCsamir28-Sep-10 23:51
VCsamir28-Sep-10 23:51 
AnswerRe: Problem to remove temporary image files once used Pin
Henry Minute29-Sep-10 0:16
Henry Minute29-Sep-10 0:16 
GeneralRe: Problem to remove temporary image files once used Pin
VCsamir29-Sep-10 2:22
VCsamir29-Sep-10 2:22 
GeneralRe: Problem to remove temporary image files once used Pin
Henry Minute29-Sep-10 2:27
Henry Minute29-Sep-10 2:27 
AnswerRe: Problem to remove temporary image files once used Pin
Luc Pattyn29-Sep-10 3:04
sitebuilderLuc Pattyn29-Sep-10 3:04 
In order to be able to delete a file, everything that points to the file must have been disposed.
Candidates are: Image.FromFile, Image.FromStream, PictureBox.ImageLocation
The problem here is you have to do special things at the end of the PictureBox's life; if the image is used in more than one location in your code, it may be hard to correctly decide on its disposal.

There also is a different approach, where the problem is avoided beforehand, by copying the image; this is a schematic example:
Image image1=Image.FromFile(...);
Bitmap bitmap1=new Bitmap(image1);        // bitmap1 is unrelated to the file!
image1.Dispose();                         // now the file is deletable
PictureBox.Image=bitmap1;
...
myForm.Close();                           // will lead to PictureBox disposal
// bitmap1 will be garbage collected at some point, this does not affect the file


Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


QuestionC# Threading Pin
Ramkithepower28-Sep-10 23:27
Ramkithepower28-Sep-10 23:27 
AnswerRe: C# Threading Pin
Pete O'Hanlon28-Sep-10 23:38
mvePete O'Hanlon28-Sep-10 23:38 
Questionfile manager Pin
kamila_me28-Sep-10 6:22
kamila_me28-Sep-10 6:22 
AnswerRe: file manager Pin
Luc Pattyn28-Sep-10 6:35
sitebuilderLuc Pattyn28-Sep-10 6:35 
Questionto show checkBox 'true' using List View Pin
annie_bel28-Sep-10 0:01
annie_bel28-Sep-10 0:01 
AnswerRe: to show checkBox 'true' using List View Pin
Michael Eber30-Sep-10 11:46
Michael Eber30-Sep-10 11:46 
QuestionHow I can get Name, Sexual, Date of birth, Nationality...from ICAO line Pin
Duong Minh Hai27-Sep-10 23:30
Duong Minh Hai27-Sep-10 23:30 
AnswerRe: How I can get Name, Sexual, Date of birth, Nationality...from ICAO line Pin
Pete O'Hanlon27-Sep-10 23:50
mvePete O'Hanlon27-Sep-10 23:50 
AnswerRe: How I can get Name, Sexual, Date of birth, Nationality...from ICAO line Pin
AspDotNetDev28-Sep-10 10:26
protectorAspDotNetDev28-Sep-10 10:26 
GeneralRe: How I can get Name, Sexual, Date of birth, Nationality...from ICAO line Pin
Pete O'Hanlon28-Sep-10 10:35
mvePete O'Hanlon28-Sep-10 10:35 
GeneralRe: How I can get Name, Sexual, Date of birth, Nationality...from ICAO line Pin
Luc Pattyn28-Sep-10 10:39
sitebuilderLuc Pattyn28-Sep-10 10:39 
GeneralRe: How I can get Name, Sexual, Date of birth, Nationality...from ICAO line Pin
Pete O'Hanlon28-Sep-10 10:51
mvePete O'Hanlon28-Sep-10 10:51 
GeneralRe: How I can get Name, Sexual, Date of birth, Nationality...from ICAO line Pin
Luc Pattyn28-Sep-10 10:59
sitebuilderLuc Pattyn28-Sep-10 10:59 
GeneralRe: How I can get Name, Sexual, Date of birth, Nationality...from ICAO line Pin
Pete O'Hanlon28-Sep-10 11:06
mvePete O'Hanlon28-Sep-10 11:06 
GeneralRe: How I can get Name, Sexual, Date of birth, Nationality...from ICAO line Pin
AspDotNetDev28-Sep-10 13:42
protectorAspDotNetDev28-Sep-10 13:42 
QuestionEnable/Disable LinkButton in Javascript Pin
SatyaKeerthi1527-Sep-10 21:19
SatyaKeerthi1527-Sep-10 21:19 
AnswerRe: Enable/Disable LinkButton in Javascript Pin
Pete O'Hanlon27-Sep-10 22:03
mvePete O'Hanlon27-Sep-10 22:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.