Jump to content

[Resolvido] try catch


nando4

Recommended Posts

Boas

Eu estou com uma duvida, embora possa parecer basica, ja nao me lembro como se faz. É o seguinte eu queria colocar um try catch em varios botoes de um form e eu queria saber se para cada catch diferente a variavel da exception tem de ser diferente?

Ou seja se no botao 1 pusesse isto

try
{

}
catch (Exception e)
{
Console.WriteLine("{0} Exception caught.", e);
}

No botao 2 tinha que por "e2" por exemplo.

Cumps

Edited by thoga31
GeSHi
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.