Click here to Skip to main content
15,913,570 members
Home / Discussions / C#
   

C#

 
GeneralRe: QR barcode decoder problem. Pin
S K Y25-Jun-09 20:47
S K Y25-Jun-09 20:47 
GeneralRe: QR barcode decoder problem. Pin
Christian Graus25-Jun-09 20:58
protectorChristian Graus25-Jun-09 20:58 
GeneralRe: QR barcode decoder problem. Pin
Mycroft Holmes26-Jun-09 0:41
professionalMycroft Holmes26-Jun-09 0:41 
QuestionHow to get stack trace Pin
LiYS25-Jun-09 16:30
LiYS25-Jun-09 16:30 
AnswerRe: How to get stack trace Pin
Luc Pattyn25-Jun-09 16:33
sitebuilderLuc Pattyn25-Jun-09 16:33 
GeneralRe: How to get stack trace Pin
LiYS25-Jun-09 17:17
LiYS25-Jun-09 17:17 
QuestionAsk about OO Concept Pin
sky391325-Jun-09 14:32
sky391325-Jun-09 14:32 
AnswerRe: Ask about OO Concept Pin
Luc Pattyn25-Jun-09 14:48
sitebuilderLuc Pattyn25-Jun-09 14:48 
AnswerRe: Ask about OO Concept Pin
N a v a n e e t h25-Jun-09 15:40
N a v a n e e t h25-Jun-09 15:40 
Questionrunning a service periodically Pin
mark_me25-Jun-09 12:00
mark_me25-Jun-09 12:00 
AnswerRe: running a service periodically Pin
Luc Pattyn25-Jun-09 12:22
sitebuilderLuc Pattyn25-Jun-09 12:22 
GeneralRe: running a service periodically Pin
mark_me25-Jun-09 15:34
mark_me25-Jun-09 15:34 
GeneralRe: running a service periodically Pin
Luc Pattyn25-Jun-09 15:35
sitebuilderLuc Pattyn25-Jun-09 15:35 
Questionkeydown event on minimized form ! Pin
kubibay25-Jun-09 8:46
kubibay25-Jun-09 8:46 
AnswerRe: keydown event on minimized form ! Pin
Rajesh R Subramanian25-Jun-09 9:29
professionalRajesh R Subramanian25-Jun-09 9:29 
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 

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.