Click here to Skip to main content
15,889,582 members
Home / Discussions / C#
   

C#

 
GeneralRe: Documentation Pin
R. Giskard Reventlov10-Mar-10 3:16
R. Giskard Reventlov10-Mar-10 3:16 
AnswerRe: Documentation Pin
NickPace10-Mar-10 3:50
NickPace10-Mar-10 3:50 
Questionptz camera control Pin
sindhumahe9-Mar-10 23:57
sindhumahe9-Mar-10 23:57 
AnswerRe: ptz camera control Pin
CDP180210-Mar-10 1:00
CDP180210-Mar-10 1:00 
Question[SOLVED] Catching several (hierarchically unrelated) exceptions in the same catch block Pin
blackblizzard9-Mar-10 23:49
blackblizzard9-Mar-10 23:49 
AnswerRe: Catching several (hierarchically unrelated) exceptions in the same catch block Pin
#realJSOP10-Mar-10 0:07
mve#realJSOP10-Mar-10 0:07 
GeneralRe: Catching several (hierarchically unrelated) exceptions in the same catch block Pin
blackblizzard10-Mar-10 0:10
blackblizzard10-Mar-10 0:10 
AnswerRe: Catching several (hierarchically unrelated) exceptions in the same catch block Pin
Keith Barrow10-Mar-10 0:09
professionalKeith Barrow10-Mar-10 0:09 
You need to do the second. I'm actually surprised Java has the first syntax, though it does make sense if you don't access the Exception object, so I suspect the Java syntax is really [good] syntactic sugar. If you do need to access the Exception object (as in my snippet) and the first syntax is used the compiler would have hellish time as it wouldn't be able to work out the Exception object type etc...

C#
try
{
//...
}
catch (NullReferenceException ex)
{
    Console.WriteLine(ex.Source);
}
catch (ArgumentException ex)
{
    Console.WriteLine(ex.ParamName);
}

is OK, but

C#
try
{
//...
}
//Not sure this is legal in Java, it isn't in c#, even without the "ex"s
catch (NullReferenceException ex, ArgumentException ex)
{
   // this would fail anyway as NullReferenceException does not have a paramname property.
   Console.WriteLine(ex.ParamName);
}

Hope this helps!
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.

GeneralRe: Catching several (hierarchically unrelated) exceptions in the same catch block Pin
blackblizzard10-Mar-10 0:12
blackblizzard10-Mar-10 0:12 
AnswerRe: [SOLVED] Catching several (hierarchically unrelated) exceptions in the same catch block Pin
AspDotNetDev10-Mar-10 12:47
protectorAspDotNetDev10-Mar-10 12:47 
GeneralRe: [SOLVED] Catching several (hierarchically unrelated) exceptions in the same catch block Pin
blackblizzard10-Mar-10 20:31
blackblizzard10-Mar-10 20:31 
GeneralRe: [SOLVED] Catching several (hierarchically unrelated) exceptions in the same catch block Pin
AspDotNetDev10-Mar-10 20:50
protectorAspDotNetDev10-Mar-10 20:50 
GeneralRe: [SOLVED] Catching several (hierarchically unrelated) exceptions in the same catch block Pin
blackblizzard10-Mar-10 21:10
blackblizzard10-Mar-10 21:10 
GeneralRe: [SOLVED] Catching several (hierarchically unrelated) exceptions in the same catch block Pin
AspDotNetDev10-Mar-10 21:55
protectorAspDotNetDev10-Mar-10 21:55 
GeneralRe: [SOLVED] Catching several (hierarchically unrelated) exceptions in the same catch block Pin
blackblizzard10-Mar-10 22:00
blackblizzard10-Mar-10 22:00 
QuestionSending email and keeping a copy on the server Pin
eyalbi0079-Mar-10 22:53
eyalbi0079-Mar-10 22:53 
AnswerRe: Sending email and keeping a copy on the server Pin
Gerrit44410-Mar-10 0:07
Gerrit44410-Mar-10 0:07 
AnswerRe: Sending email and keeping a copy on the server Pin
DX Roster10-Mar-10 0:24
DX Roster10-Mar-10 0:24 
GeneralRe: Sending email and keeping a copy on the server Pin
Saksida Bojan10-Mar-10 5:42
Saksida Bojan10-Mar-10 5:42 
GeneralRe: Sending email and keeping a copy on the server Pin
eyalbi00714-Mar-10 0:18
eyalbi00714-Mar-10 0:18 
GeneralRe: Sending email and keeping a copy on the server Pin
Saksida Bojan14-Mar-10 2:04
Saksida Bojan14-Mar-10 2:04 
Questionaudio sound suite for .net crack Pin
Fatemi9-Mar-10 22:43
Fatemi9-Mar-10 22:43 
GeneralRe: audio sound suite for .net crack Pin
harold aptroot9-Mar-10 23:14
harold aptroot9-Mar-10 23:14 
GeneralRe: audio sound suite for .net crack Pin
Fatemi9-Mar-10 23:33
Fatemi9-Mar-10 23:33 
GeneralRe: audio sound suite for .net crack Pin
harold aptroot9-Mar-10 23:43
harold aptroot9-Mar-10 23:43 

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.