Hi,
Normally my programming style is as follows:
/*************** */
if ( SomeObject.CanY ouDoThis() == true)
SomeObject.DoSt uff();
else
MessageBox.Show ("Nope, sowwy...");
/*************** */
Meaning, most usually I don't just call "DoStuff()" and show the 'nope
sowwy' message if I caught an exception.
Now, the question is: can someone explain why the
PrincipalPermis sion's Demand method seems to work like this? MS
recommends to try the Demand() method before you do something secure,
and catch any exception to handle non-authenticated users. This seems
a bit like misusing exceptions?
Thanks.
-Jeroen
Normally my programming style is as follows:
/*************** */
if ( SomeObject.CanY ouDoThis() == true)
SomeObject.DoSt uff();
else
MessageBox.Show ("Nope, sowwy...");
/*************** */
Meaning, most usually I don't just call "DoStuff()" and show the 'nope
sowwy' message if I caught an exception.
Now, the question is: can someone explain why the
PrincipalPermis sion's Demand method seems to work like this? MS
recommends to try the Demand() method before you do something secure,
and catch any exception to handle non-authenticated users. This seems
a bit like misusing exceptions?
Thanks.
-Jeroen
Comment