Click here to Skip to main content
16,006,605 members
Home / Discussions / C#
   

C#

 
GeneralRe: Save Form screen as jpg-file Pin
Ajay.k_Singh25-Sep-07 0:43
Ajay.k_Singh25-Sep-07 0:43 
GeneralRe: Save Form screen as jpg-file Pin
anderslundsgard25-Sep-07 4:47
anderslundsgard25-Sep-07 4:47 
QuestionEquivalent of CStringArray in C# Pin
Mushtaque Nizamani24-Sep-07 22:26
Mushtaque Nizamani24-Sep-07 22:26 
AnswerRe: Equivalent of CStringArray in C# Pin
Martin#24-Sep-07 22:32
Martin#24-Sep-07 22:32 
GeneralRe: Equivalent of CStringArray in C# [modified] Pin
Mushtaque Nizamani24-Sep-07 22:39
Mushtaque Nizamani24-Sep-07 22:39 
QuestionInheritance in C# (class + interface) Pin
kaminem24-Sep-07 22:22
kaminem24-Sep-07 22:22 
AnswerRe: Inheritance in C# (class + interface) Pin
Colin Angus Mackay24-Sep-07 22:55
Colin Angus Mackay24-Sep-07 22:55 
QuestionEmpty Catch Pin
Malcolm Smart24-Sep-07 22:04
Malcolm Smart24-Sep-07 22:04 
Hi
void DoThis()
{
   try
      {
       DangerousCall();
      }
   catch( MyExpectedException e )  //cool <-- I threw this in my DangerousCall method
   {
        //handle my exception here
   }
   catch ( Exception e1 ) // <-- not what I expected but caught anyway
   {
        //this wasn't expected, but report the contents of e1
   }
}


You can replace the catch all catch ( Exception e1 ) with a parameterless catch catch { ... }.

...snip...
   catch( MyExpectedException e )  //cool <-- I threw this in my DangerousCall method
   {
        //handle my exception here
   }
   catch  // <-- not what I expected but caught anyway
   {
        //ok - so what do I do here?  How do I know what failed?
   }

Why? What does this give you? Can you get any exception info?

I've done a test and you can't use catch (Exception e) with catch { } as the compiler knows that is already a catch all in there. Confused D'Oh! | :doh: .

"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF


"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."

AnswerRe: Empty Catch Pin
pmarfleet24-Sep-07 22:16
pmarfleet24-Sep-07 22:16 
GeneralRe: Empty Catch Pin
Malcolm Smart24-Sep-07 22:22
Malcolm Smart24-Sep-07 22:22 
GeneralRe: Empty Catch Pin
Colin Angus Mackay24-Sep-07 22:33
Colin Angus Mackay24-Sep-07 22:33 
GeneralRe: Empty Catch Pin
pmarfleet24-Sep-07 22:35
pmarfleet24-Sep-07 22:35 
AnswerRe: Empty Catch Pin
Guffa24-Sep-07 23:11
Guffa24-Sep-07 23:11 
GeneralRe: Empty Catch Pin
Scott Dorman25-Sep-07 3:59
professionalScott Dorman25-Sep-07 3:59 
GeneralRe: Empty Catch Pin
Guffa25-Sep-07 10:21
Guffa25-Sep-07 10:21 
QuestionDevelop Outlook in C# Windows forms Pin
senselva24-Sep-07 21:58
senselva24-Sep-07 21:58 
AnswerRe: Develop Outlook in C# Windows forms Pin
Corinna John25-Sep-07 0:56
Corinna John25-Sep-07 0:56 
QuestionGoogle Suggest feature with ASP.NET 2.0 Pin
jebin k24-Sep-07 20:39
jebin k24-Sep-07 20:39 
AnswerRe: Google Suggest feature with ASP.NET 2.0 Pin
dengboo24-Sep-07 20:48
dengboo24-Sep-07 20:48 
GeneralRe: Google Suggest feature with ASP.NET 2.0 Pin
jebin k25-Sep-07 1:25
jebin k25-Sep-07 1:25 
QuestionReportingService.GetReportParameters Pin
amraouf24-Sep-07 20:18
amraouf24-Sep-07 20:18 
AnswerRe: ReportingService.GetReportParameters Pin
pmarfleet24-Sep-07 21:35
pmarfleet24-Sep-07 21:35 
GeneralRe: ReportingService.GetReportParameters Pin
amraouf24-Sep-07 21:52
amraouf24-Sep-07 21:52 
GeneralRe: ReportingService.GetReportParameters Pin
pmarfleet24-Sep-07 22:11
pmarfleet24-Sep-07 22:11 
Questioncode for reading afile from the folder on c# Pin
ramyanaidu24-Sep-07 20:08
ramyanaidu24-Sep-07 20:08 

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.