Click here to Skip to main content
15,919,434 members
Home / Discussions / C#
   

C#

 
Generalfunction usage in a .config file Pin
Ryan@Salamandertechnologies.com19-Jul-04 6:39
sussRyan@Salamandertechnologies.com19-Jul-04 6:39 
GeneralRe: function usage in a .config file Pin
Heath Stewart19-Jul-04 8:38
protectorHeath Stewart19-Jul-04 8:38 
GeneralRe: function usage in a .config file Pin
RB@Emphasys19-Jul-04 9:02
RB@Emphasys19-Jul-04 9:02 
GeneralRe: function usage in a .config file Pin
Heath Stewart19-Jul-04 9:07
protectorHeath Stewart19-Jul-04 9:07 
GeneralRe: function usage in a .config file Pin
Andy Brummer19-Jul-04 9:12
sitebuilderAndy Brummer19-Jul-04 9:12 
GeneralRe: function usage in a .config file Pin
RB@Emphasys19-Jul-04 9:48
RB@Emphasys19-Jul-04 9:48 
GeneralApplicationException VS Exception Pin
Gimpy198319-Jul-04 5:00
Gimpy198319-Jul-04 5:00 
GeneralRe: ApplicationException VS Exception Pin
Heath Stewart19-Jul-04 5:30
protectorHeath Stewart19-Jul-04 5:30 
Exceptions are caught in order:
try
{
}
catch (TargetException e) // Derivative of ApplicationException
{
}
catch (ApplicationException e) // Derivative of Exception
{
}
catch (Exception e)
{
}
If an exception was thrown and was a TargetException, then it would be caught by the first catch block. If it was any other derivative of ApplicationException (or ApplicationException itself), then the second target block would catch it. If it was any other Exception, the last line will catch it. If you don't plan on using the variables, you can drop them (just use catch (Exception). If you don't plan on using the exception information, you can simply use catch to catch all exceptions.

If you reverse the order of the first two catch blocks, the first catch block will catch all derivatives of ApplicationException, including an ApplicationException itself. In fact, this generates a compiler error.

You should take a look at the C# Language Specification[^].

 

Microsoft MVP, Visual C#
My Articles
GeneralCalled but not executed :confused: Pin
Gimpy198319-Jul-04 4:54
Gimpy198319-Jul-04 4:54 
GeneralRe: Called but not executed :confused: Pin
Heath Stewart19-Jul-04 5:35
protectorHeath Stewart19-Jul-04 5:35 
GeneralRe: Called but not executed :confused: Pin
Gimpy198319-Jul-04 9:27
Gimpy198319-Jul-04 9:27 
GeneralRe: Called but not executed :confused: Pin
Heath Stewart19-Jul-04 9:32
protectorHeath Stewart19-Jul-04 9:32 
GeneralGoing Unmanaged doesn't free Memory Pin
Guilio karadanais19-Jul-04 4:24
Guilio karadanais19-Jul-04 4:24 
GeneralRe: Going Unmanaged doesn't free Memory Pin
Heath Stewart19-Jul-04 4:37
protectorHeath Stewart19-Jul-04 4:37 
GeneralRe: Going Unmanaged doesn't free Memory Pin
Guilio karadanais19-Jul-04 5:07
Guilio karadanais19-Jul-04 5:07 
GeneralHex to Dec conversion (big numbas!) Pin
Blubbo19-Jul-04 4:06
Blubbo19-Jul-04 4:06 
GeneralRe: Hex to Dec conversion (big numbas!) Pin
Heath Stewart19-Jul-04 4:30
protectorHeath Stewart19-Jul-04 4:30 
GeneralEAP Certificate requests... Pin
Vodstok19-Jul-04 4:03
Vodstok19-Jul-04 4:03 
GeneralRe: EAP Certificate requests... Pin
Heath Stewart19-Jul-04 4:42
protectorHeath Stewart19-Jul-04 4:42 
GeneralRegular Expressions Pin
Anonymous19-Jul-04 3:54
Anonymous19-Jul-04 3:54 
Questionhow do I get the cursor position?? Pin
Stephan Wright19-Jul-04 1:31
Stephan Wright19-Jul-04 1:31 
AnswerRe: how do I get the cursor position?? Pin
misterbear19-Jul-04 2:07
misterbear19-Jul-04 2:07 
GeneralRe: how do I get the cursor position?? Pin
Stephan Wright19-Jul-04 2:19
Stephan Wright19-Jul-04 2:19 
GeneralRe: how do I get the cursor position?? Pin
Heath Stewart19-Jul-04 3:18
protectorHeath Stewart19-Jul-04 3:18 
GeneralRe: how do I get the cursor position?? Pin
Stephan Wright19-Jul-04 3:53
Stephan Wright19-Jul-04 3:53 

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.