Click here to Skip to main content
16,005,128 members
Home / Discussions / C#
   

C#

 
GeneralRe: DataSet generator error Pin
Dave Kreskowiak28-Jun-04 4:05
mveDave Kreskowiak28-Jun-04 4:05 
GeneralRe: DataSet generator error Pin
Heath Stewart28-Jun-04 4:11
protectorHeath Stewart28-Jun-04 4:11 
GeneralRe: DataSet generator error Pin
Member 114126629-Jun-04 2:10
Member 114126629-Jun-04 2:10 
QuestionBest way to print an image that may be larger than one page? Pin
Pain_Elemental27-Jun-04 20:15
Pain_Elemental27-Jun-04 20:15 
AnswerRe: Best way to print an image that may be larger than one page? Pin
Heath Stewart28-Jun-04 3:55
protectorHeath Stewart28-Jun-04 3:55 
GeneralOne more security question Pin
MKlucher27-Jun-04 18:36
MKlucher27-Jun-04 18:36 
GeneralRe: One more security question Pin
Heath Stewart27-Jun-04 18:44
protectorHeath Stewart27-Jun-04 18:44 
GeneralRe: One more security question Pin
MKlucher27-Jun-04 19:03
MKlucher27-Jun-04 19:03 
Thats what is getting me confused, The .Demand doesn't throw an exception but when I actually try to modify the file then it throws a security exception.

This is some of the test code I have in my program now (that's to test stuff)

<br />
FileIOPermission canAccess = new FileIOPermission(FileIOPermissionAccess.Write, "C:\\");<br />
try {<br />
canAccess.Demand();<br />
File.Delete(cmdArgs[0]); // This contains a file on C<br />
}<br />
catch {<br />
// Let user know here<br />
}<br />


I would expect the .Demand() call to throw the exception but it doesn't, I get the security error when calling File.Delete, which doesn't make sense... (I also tried replacing Write with AllAccess)

The reason I want to run a "pre-check" like this is the delete/renaming stuff doesn't occur until 15 seconds or so in the program so I don't want to make the user wait 15 seconds just to find out that they can't do anything because the code isn't running with the proper permissions.

P.S. The SecurityException message that is thrown is: "Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed."
GeneralRe: One more security question Pin
Heath Stewart27-Jun-04 19:12
protectorHeath Stewart27-Jun-04 19:12 
GeneralRun Expect scripts from managed code Pin
inyoursadachine27-Jun-04 18:07
inyoursadachine27-Jun-04 18:07 
GeneralRe: Run Expect scripts from managed code Pin
Heath Stewart27-Jun-04 18:18
protectorHeath Stewart27-Jun-04 18:18 
GeneralMPEG to AVI Pin
BigBlob20227-Jun-04 10:51
BigBlob20227-Jun-04 10:51 
GeneralRe: MPEG to AVI Pin
leppie27-Jun-04 13:13
leppie27-Jun-04 13:13 
GeneralRe: MPEG to AVI Pin
BigBlob20227-Jun-04 14:23
BigBlob20227-Jun-04 14:23 
GeneralRe: MPEG to AVI Pin
Heath Stewart27-Jun-04 17:46
protectorHeath Stewart27-Jun-04 17:46 
QuestionCatching key events to a panel? Pin
misterbear27-Jun-04 7:53
misterbear27-Jun-04 7:53 
AnswerRe: Catching key events to a panel? Pin
Karl 200027-Jun-04 9:02
Karl 200027-Jun-04 9:02 
GeneralRe: Catching key events to a panel? Pin
misterbear27-Jun-04 10:54
misterbear27-Jun-04 10:54 
GeneralRe: Catching key events to a panel? Pin
Karl 200027-Jun-04 11:00
Karl 200027-Jun-04 11:00 
GeneralNeed Help Pleaaase Pin
hani_aql27-Jun-04 5:29
hani_aql27-Jun-04 5:29 
GeneralRe: Need Help Pleaaase Pin
Anonymous27-Jun-04 13:05
Anonymous27-Jun-04 13:05 
GeneralRe: Need Help Pleaaase Pin
Dave Kreskowiak27-Jun-04 14:37
mveDave Kreskowiak27-Jun-04 14:37 
Generalfirewall Pin
shahrokh nabavi27-Jun-04 2:04
shahrokh nabavi27-Jun-04 2:04 
GeneralRe: firewall Pin
leppie27-Jun-04 3:55
leppie27-Jun-04 3:55 
GeneralRe: firewall Pin
Colin Angus Mackay28-Jun-04 0:39
Colin Angus Mackay28-Jun-04 0:39 

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.