Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ExceptForm Exception Handling :)
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00847522
Message ID:
00849483
Vues:
28
>/* Below line writen for raise run-time SystemException::Exception */
>//-------------------------------------------------------------------
>object rnd;
>rnd = new System.Random();
>foo(rnd); /* foo has one object type argument.
> * but foo will type conversiton to o paramater
> * System.Text.Encoding its not possible and
> * throw SystemException.*/
>//-------------------------------------------------------------------
>
>and now trying in catch block and show ExceptionForm;
>
>mmAppBase.Log.WriteException(e);
>// Display the Exception form /*its parts of your sample code.*/
>mmExceptionForm ExceptForm = new mmExceptionForm(e.Message, e.StackTrace);

You can just throw a new exception and the default error manager will catch it and display the exception form for you. Here's a sample:
try
{
  int iVar = int.Parse("ABC");
}
catch (System.Exception ex)
{
  throw (ex);
}
However, if you really need to handle this yourself, you need to make sure you call the Show() method of the form.
try
{
  int iVar = int.Parse("ABC");
}
catch (System.Exception ex)
{
  mmExceptionForm ExceptForm = new mmExceptionForm(ex.Message, ex.StackTrace);
  ExceptForm.Show();}
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform