|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
unhandled SecurityException in Visual Basic 2005 ExpressI'm trying to read in a text file using code that I copied and pasted from
the MS help file. Using Reader As New _ Microsoft.VisualBasic.FileIO.TextFieldParser("c:\bankcheck") At this line I get "Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed." I've tried researching this in the help files and on the web but, I must confess, that what I've found has only confused me more. The file DOES exist and I have full permissions to it. What am I doing wrong and how can I fix it? Thanks for you help. Ken Ken,
I tried your command and cannot get any error. Your file description looks strange to me, are you sure it exist and is a text file? Cor Show quoteHide quote "KenEisman" <KenEis***@discussions.microsoft.com> schreef in bericht news:23CD5082-BCD9-48E1-8D5A-62EC3AB051F8@microsoft.com... > I'm trying to read in a text file using code that I copied and pasted from > the MS help file. > > Using Reader As New _ > Microsoft.VisualBasic.FileIO.TextFieldParser("c:\bankcheck") > > At this line I get "Request for the permission of type > 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, > Culture=neutral, PublicKeyToken=b77a5c561934e089' failed." > > I've tried researching this in the help files and on the web but, I must > confess, that what I've found has only confused me more. > > The file DOES exist and I have full permissions to it. What am I doing > wrong > and how can I fix it? > > Thanks for you help. > Ken > KenEisman wrote:
> At this line I get "Request for the permission of type /You/ might have, but your /code/ doesn't.> 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, > Culture=neutral, PublicKeyToken=b77a5c561934e089' failed." > The file DOES exist and I have full permissions to it. Code Access Security, part of the .Net Framework, does away with all that "you have to run it under this account for it to work" nonsense. Every program runs in a security "sandbox" (although the "LocalZone" one is /pretty/ big!). Are you running this code from a network file share? Something like \\server\share\...\myprogram.exe If so, your program runs in a /much/ smaller "sandbox" - by default, the Framework doesn't distinguish between your network share and www.DodgyAndDangerousSoftware.com (apologies to anyone who actually owns a site of this name!) Read up on the CASPOL (command line) utility or find the "Microsoft .Net Framework ?.? Configuration" program (GUI) in your PC's Administative Tools. HTH, Phill W.
array element isexist ?
disabling checkbox in checkedlistbox Argument not specified Datagrids (again) ComboBox SelectionChangeCommitted event fires twice How much disk space is needed... Deriving from Abstract Classes with Enums and Varying Object Types VB6 to VB.NET Error Compiling Create Recordset from a non standard data source |
|||||||||||||||||||||||