Click here to Skip to main content
15,910,277 members
Home / Discussions / C#
   

C#

 
GeneralRe: VB.NET or C# Pin
Luis Ricardo16-May-04 9:24
Luis Ricardo16-May-04 9:24 
GeneralRe: VB.NET or C# Pin
TigerNinja_16-May-04 18:34
TigerNinja_16-May-04 18:34 
GeneralRe: VB.NET or C# Pin
sreejith ss nair16-May-04 19:37
sreejith ss nair16-May-04 19:37 
GeneralModifing the configuration of an IIS virtual dir Pin
Mauricio Ritter16-May-04 6:43
Mauricio Ritter16-May-04 6:43 
GeneralRe: Modifing the configuration of an IIS virtual dir Pin
Heath Stewart16-May-04 11:57
protectorHeath Stewart16-May-04 11:57 
Generalregd datagrid Pin
karteek16-May-04 6:19
karteek16-May-04 6:19 
GeneralRe: regd datagrid Pin
Heath Stewart16-May-04 12:12
protectorHeath Stewart16-May-04 12:12 
GeneralGranting/Demanding a custom permission Pin
Mike Hodnick16-May-04 5:01
Mike Hodnick16-May-04 5:01 
I've created a very, very simple custom CodeAccessPermission class. It basically does nothing more than override the necessary base class methods and implement IUnrestrictedPermission.

In another class, I want to perform an imperative security check to ensure the caller has been granted my custom permission:

<br />
public static void ReadData()<br />
{<br />
   CustomPermission MyPermission = <br />
	new CustomPermission(PermissionState.Unrestricted);<br />
   MyPermission.Demand();<br />
<br />
   //perform method stuff...<br />
}<br />


The problem is, I haven't done anything to specifically grant my application this permission, and when I call Demand no SecurityException is thrown. But, I want a SecurityException to be thrown since I have not explicitly granted any code that permission.

Why does this happen?


- Mike

-------------------------
"No human being would stack books like that." - Dr. Venkman
GeneralRe: Granting/Demanding a custom permission Pin
Heath Stewart16-May-04 12:02
protectorHeath Stewart16-May-04 12:02 
GeneralRe: Granting/Demanding a custom permission Pin
Mike Hodnick17-May-04 5:27
Mike Hodnick17-May-04 5:27 
QuestionHow can I transfer the video stream use usb cam Pin
haruntopuz16-May-04 4:02
haruntopuz16-May-04 4:02 
AnswerRe: How can I transfer the video stream use usb cam Pin
Dave Kreskowiak16-May-04 4:32
mveDave Kreskowiak16-May-04 4:32 
AnswerRe: How can I transfer the video stream use usb cam Pin
Wackatronic30-May-04 12:06
Wackatronic30-May-04 12:06 
GeneralTransfering Images with TAPI Pin
Member 69108916-May-04 2:59
Member 69108916-May-04 2:59 
GeneralRe: Transfering Images with TAPI Pin
Dave Kreskowiak16-May-04 4:28
mveDave Kreskowiak16-May-04 4:28 
QuestionGetBaseline from Font? Pin
Roger Alsing16-May-04 2:39
Roger Alsing16-May-04 2:39 
AnswerRe: GetBaseline from Font? Pin
leppie16-May-04 4:09
leppie16-May-04 4:09 
GeneralSerial communication problem Pin
wk_vigorous16-May-04 0:10
wk_vigorous16-May-04 0:10 
GeneralRe: Serial communication problem Pin
Anonymous16-May-04 1:21
Anonymous16-May-04 1:21 
GeneralRe: Serial communication problem Pin
wk_vigorous16-May-04 21:52
wk_vigorous16-May-04 21:52 
Generallimit the mouse movement Pin
Member 89285615-May-04 20:44
Member 89285615-May-04 20:44 
GeneralRe: limit the mouse movement Pin
leppie15-May-04 22:15
leppie15-May-04 22:15 
GeneralRe: limit the mouse movement Pin
Hesham Amin15-May-04 22:55
Hesham Amin15-May-04 22:55 
GeneralRe: limit the mouse movement Pin
Member 89285616-May-04 4:31
Member 89285616-May-04 4:31 
QuestionHow to generate keyboard events from a sys service Pin
catalin_im15-May-04 11:38
catalin_im15-May-04 11:38 

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.