Click here to Skip to main content
15,881,852 members
Home / Discussions / C#
   

C#

 
GeneralRe: keydown event on minimized form ! Pin
kubibay25-Jun-09 9:56
kubibay25-Jun-09 9:56 
GeneralRe: keydown event on minimized form ! Pin
Rajesh R Subramanian25-Jun-09 10:15
professionalRajesh R Subramanian25-Jun-09 10:15 
GeneralRe: keydown event on minimized form ! Pin
kubibay25-Jun-09 10:20
kubibay25-Jun-09 10:20 
GeneralRe: keydown event on minimized form ! Pin
EliottA25-Jun-09 10:25
EliottA25-Jun-09 10:25 
GeneralRe: keydown event on minimized form ! Pin
kubibay25-Jun-09 10:29
kubibay25-Jun-09 10:29 
Questionusing versus out of scope Pin
jackgeek25-Jun-09 8:03
jackgeek25-Jun-09 8:03 
AnswerRe: using versus out of scope Pin
harold aptroot25-Jun-09 8:14
harold aptroot25-Jun-09 8:14 
AnswerRe: using versus out of scope Pin
OriginalGriff25-Jun-09 8:20
mveOriginalGriff25-Jun-09 8:20 
It's not so much a case of correctness, as necessity.
The difference is that when the "using" code block goes out of scope, the resources used are immediately disposed. MSDN on using[^]
In the second case, they will be disposed when the garbage collector feels like it.
For example, if you open a file for exclusive access, then use using. If you don't, then the file may not be completely freed and released by the time you next come around to opening it, and you could get a "file in use" exception, despite you having let go of the file four routines back.

Don't go overboard with using, but if it is a scarce resource, or similar, the using is the way to go.

No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

GeneralRe: using versus out of scope Pin
Mirko198025-Jun-09 21:44
Mirko198025-Jun-09 21:44 
QuestionSerial Port synchronous read Pin
12425625-Jun-09 7:56
12425625-Jun-09 7:56 
Questiongui Pin
Alessio Granzotto25-Jun-09 7:34
Alessio Granzotto25-Jun-09 7:34 
AnswerRe: gui Pin
dan!sh 25-Jun-09 7:41
professional dan!sh 25-Jun-09 7:41 
AnswerRe: gui Pin
Arindam Sinha25-Jun-09 22:19
Arindam Sinha25-Jun-09 22:19 
GeneralRe: gui Pin
Alessio Granzotto25-Jun-09 22:27
Alessio Granzotto25-Jun-09 22:27 
QuestionHow to change dynamically Action property of SoapRpcMethodAttribute Attribute ? Pin
redius25-Jun-09 7:27
redius25-Jun-09 7:27 
QuestionWebbrowser Messagebox Dialogresult? Pin
f1ref1re25-Jun-09 6:05
f1ref1re25-Jun-09 6:05 
AnswerRe: Webbrowser Messagebox Dialogresult? Pin
Arindam Sinha25-Jun-09 21:57
Arindam Sinha25-Jun-09 21:57 
QuestionPrint a form Pin
Samb198525-Jun-09 5:59
Samb198525-Jun-09 5:59 
AnswerRe: Print a form Pin
musefan25-Jun-09 6:29
musefan25-Jun-09 6:29 
GeneralRe: Print a form Pin
Samb198525-Jun-09 6:42
Samb198525-Jun-09 6:42 
QuestionConverter converter = new Converter(delegate(int value) Pin
Angel Romero25-Jun-09 4:39
Angel Romero25-Jun-09 4:39 
QuestionRe: Converter converter = new Converter(delegate(int value) Pin
led mike25-Jun-09 4:41
led mike25-Jun-09 4:41 
AnswerRe: Converter converter = new Converter(delegate(int value) Pin
Angel Romero25-Jun-09 4:45
Angel Romero25-Jun-09 4:45 
GeneralRe: Converter converter = new Converter(delegate(int value) Pin
led mike25-Jun-09 4:51
led mike25-Jun-09 4:51 
GeneralRe: Converter converter = new Converter(delegate(int value) Pin
Angel Romero25-Jun-09 4:55
Angel Romero25-Jun-09 4:55 

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.