Click here to Skip to main content
15,891,856 members
Home / Discussions / C#
   

C#

 
Questionhow to programing Microsoft Management Console ?? Pin
GREG_DORIANcod28-Feb-11 4:58
professionalGREG_DORIANcod28-Feb-11 4:58 
AnswerRe: how to programing Microsoft Management Console ?? Pin
Eddy Vluggen28-Feb-11 6:02
professionalEddy Vluggen28-Feb-11 6:02 
AnswerRe: how to programing Microsoft Management Console ?? Pin
RaviRanjanKr28-Feb-11 17:09
professionalRaviRanjanKr28-Feb-11 17:09 
Questionaccessing folder from project Pin
jashimu28-Feb-11 4:37
jashimu28-Feb-11 4:37 
AnswerRe: accessing folder from project Pin
OriginalGriff28-Feb-11 5:30
mveOriginalGriff28-Feb-11 5:30 
GeneralRe: accessing folder from project Pin
jashimu28-Feb-11 7:03
jashimu28-Feb-11 7:03 
GeneralRe: accessing folder from project Pin
Tony Richards28-Feb-11 7:51
Tony Richards28-Feb-11 7:51 
GeneralRe: accessing folder from project [modified] Pin
OriginalGriff28-Feb-11 8:41
mveOriginalGriff28-Feb-11 8:41 
Take note of what Tony says, but also be aware that the new Bitmap(path) constructor does exactly the same thing as the Image.FromFile(path) method: It locks the file until the Bitmap is disposed. MSDN[^]

What that means is that is you do:
PictureBox.Image = New Bitmap("myImage")
PictureBox.Image = New Bitmap("myOtherImage")
PictureBox.Image = New Bitmap("myImage")
You will get an exception because the file "myImage" is in use for the third bitmap.

That doesn't mean you can change images in a button click event: the file remains locked until the Bitmap is Disposed. I.e. when the Garbage collector finally gets called in, and decides it is no longer needed. That could be now, could be next week. Use the Stream method instead: it does not have that problem.


[edit]Luc kindly pointed out that it is a read lock, so only write, rename, and delete operations will be affected. So if you are just displaying the image and not changing the file, it won't be a problem.[/edit]
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."

modified on Monday, February 28, 2011 3:27 PM

GeneralRe: accessing folder from project Pin
Luc Pattyn28-Feb-11 9:04
sitebuilderLuc Pattyn28-Feb-11 9:04 
GeneralRe: accessing folder from project Pin
OriginalGriff28-Feb-11 9:26
mveOriginalGriff28-Feb-11 9:26 
AnswerRe: accessing folder from project Pin
Luc Pattyn28-Feb-11 9:34
sitebuilderLuc Pattyn28-Feb-11 9:34 
AnswerRe: accessing folder from project Pin
OriginalGriff28-Feb-11 9:36
mveOriginalGriff28-Feb-11 9:36 
GeneralRe: accessing folder from project Pin
Luc Pattyn28-Feb-11 9:42
sitebuilderLuc Pattyn28-Feb-11 9:42 
QuestionCombobox large Data Pin
sanforjackass28-Feb-11 4:22
sanforjackass28-Feb-11 4:22 
AnswerRe: Combobox large Data Pin
Blue_Boy28-Feb-11 4:25
Blue_Boy28-Feb-11 4:25 
AnswerRe: Combobox large Data Pin
Ian Shlasko28-Feb-11 4:28
Ian Shlasko28-Feb-11 4:28 
GeneralRe: Combobox large Data Pin
sanforjackass28-Feb-11 4:34
sanforjackass28-Feb-11 4:34 
GeneralRe: Combobox large Data Pin
Ian Shlasko28-Feb-11 4:42
Ian Shlasko28-Feb-11 4:42 
GeneralRe: Combobox large Data Pin
sanforjackass28-Feb-11 4:52
sanforjackass28-Feb-11 4:52 
GeneralRe: Combobox large Data Pin
Ian Shlasko28-Feb-11 4:54
Ian Shlasko28-Feb-11 4:54 
GeneralRe: Combobox large Data Pin
Dave Kreskowiak28-Feb-11 8:55
mveDave Kreskowiak28-Feb-11 8:55 
GeneralRe: Combobox large Data Pin
darkelv1-Mar-11 22:23
darkelv1-Mar-11 22:23 
GeneralRe: Combobox large Data Pin
Pete O'Hanlon28-Feb-11 4:43
mvePete O'Hanlon28-Feb-11 4:43 
AnswerRe: Combobox large Data Pin
Eddy Vluggen28-Feb-11 4:29
professionalEddy Vluggen28-Feb-11 4:29 
Questionsqlite error in c# program Pin
avinash51028-Feb-11 3:39
avinash51028-Feb-11 3:39 

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.