Thursday, August 24, 2006

.NET Stuff

Html Agility Pack -- Parses html into XML. "Free" C# source code.
Must Have .NET Developer Tools -- David Hayden.

Awesome... Web Apps as Local Classes -- SteelPrice.Net
ASP.NET Applications without Web Projects -- Fritz Onion
WSCF - Schema-Based Contract-First Web Services --

From ms.public.dotnet.languages.csharp thread "Nice exceptions"

I usually create a class, called


static void Main(string[] args)

Application.Run(new Form1()); //Whatever your startup form is


catch (Exception ex)
//Notify User
MessageBox.Show( "A (uncaught) exception has occured. MyApp
cannot continue." );
//Shut down application
Application.Exit( );

This will catch any uncaught exceptions.

But Jon is right.
You catch an general exception, but you're rethrowing it.
Thus something else must catch it, or you'll get the blow-up screen.

You should should google

try catch finally brad abrams

and you can read where

"You should be writing many many more


and not so many


wrote in message
> I'm new to VS2005, I used VS2003 a bit, and I remember it didn't act
> like this.
> My code looks like :
> try
> {
> blah
> blah
> blah
> }
> catch (Exception)
> {
> MyOwnException myoe = new MyOwnException ("Error on receiving data");
> throw myoe;
> }
> And what I get when an error happens is a window telling me :
> "Application1 has encountered a problem and needs to close.
> Send Error Report Don't Send"
> Then after clicking either "Send" or "Not Send", the windows closes and
> the program vanishes.
> As far as I remember I'm catching the exception and the program should
> be keep working after that.
> Where's my fault ?

Tuesday, March 21, 2006