Click here to Skip to main content
15,893,994 members
Home / Discussions / C#
   

C#

 
GeneralRe: Visual Studio 2005 beta - an easy question Pin
McSam3-Jan-05 4:49
McSam3-Jan-05 4:49 
GeneralRe: Visual Studio 2005 beta - an easy question Pin
Dennis C. Dietrich3-Jan-05 7:58
Dennis C. Dietrich3-Jan-05 7:58 
GeneralRe: Visual Studio 2005 beta - an easy question Pin
Dennis C. Dietrich1-Jan-05 5:43
Dennis C. Dietrich1-Jan-05 5:43 
Generalpopulate a dataset from the xml Pin
dhol31-Dec-04 23:48
dhol31-Dec-04 23:48 
GeneralPixel colors found using GDI+ are different!!!!! Pin
abcxyz8231-Dec-04 22:50
abcxyz8231-Dec-04 22:50 
GeneralRe: Pixel colors found using GDI+ are different!!!!! Pin
Heath Stewart31-Dec-04 23:02
protectorHeath Stewart31-Dec-04 23:02 
GeneralUsing "using" Pin
Identity Undisclosed31-Dec-04 20:50
Identity Undisclosed31-Dec-04 20:50 
GeneralRe: Using "using" Pin
Adam Goossens31-Dec-04 22:11
Adam Goossens31-Dec-04 22:11 
Using doesn't replace try/finally. Using ensures that the object you "use" is disposed (ie, IDisposable.Dispose() is called) as soon as the using block is exited. It also ensures that Dispose() is called properly when an exception is thrown that isn't handled within the using block.

Using only works on objects that implement IDisposable, IE:

<br />
using (Font myFont = new Font("Arial", 10.0f))<br />
{<br />
    // use the font here...<br />
} // myFont.Dispose() is called here.<br />


In answer to your question though: there is no shorthand syntax for try/catch/finally.

This space for rent!
My Blog
GeneralRe: Using "using" Pin
Heath Stewart31-Dec-04 22:56
protectorHeath Stewart31-Dec-04 22:56 
GeneralRe: Using "using" Pin
Adam Goossens31-Dec-04 23:21
Adam Goossens31-Dec-04 23:21 
GeneralRe: Using &quot;using&quot; Pin
Heath Stewart1-Jan-05 6:29
protectorHeath Stewart1-Jan-05 6:29 
GeneralRe: Using &quot;using&quot; Pin
Heath Stewart31-Dec-04 23:07
protectorHeath Stewart31-Dec-04 23:07 
Generaluse shellexecute to create an email Pin
TNL31-Dec-04 18:14
TNL31-Dec-04 18:14 
GeneralRe: use shellexecute to create an email Pin
Heath Stewart31-Dec-04 22:53
protectorHeath Stewart31-Dec-04 22:53 
GeneralRe: use shellexecute to create an email Pin
TNL31-Dec-04 23:48
TNL31-Dec-04 23:48 
GeneralRe: use shellexecute to create an email Pin
Heath Stewart1-Jan-05 6:33
protectorHeath Stewart1-Jan-05 6:33 
Generalbits Pin
Tyrus18231-Dec-04 16:37
Tyrus18231-Dec-04 16:37 
GeneralRe: bits Pin
Heath Stewart31-Dec-04 22:58
protectorHeath Stewart31-Dec-04 22:58 
GeneralSIMPLE SIMPLE QUESTION Pin
...---...31-Dec-04 9:44
...---...31-Dec-04 9:44 
GeneralRe: SIMPLE SIMPLE QUESTION Pin
SimonS31-Dec-04 10:29
SimonS31-Dec-04 10:29 
GeneralRe: SIMPLE SIMPLE QUESTION Pin
Heath Stewart31-Dec-04 10:46
protectorHeath Stewart31-Dec-04 10:46 
GeneralRe: SIMPLE SIMPLE QUESTION Pin
...---...31-Dec-04 10:50
...---...31-Dec-04 10:50 
GeneralRe: SIMPLE SIMPLE QUESTION Pin
Heath Stewart31-Dec-04 11:06
protectorHeath Stewart31-Dec-04 11:06 
GeneralRe: SIMPLE SIMPLE QUESTION Pin
SimonS31-Dec-04 11:39
SimonS31-Dec-04 11:39 
GeneralRe: SIMPLE SIMPLE QUESTION Pin
Heath Stewart31-Dec-04 12:22
protectorHeath Stewart31-Dec-04 12:22 

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.