Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 23rd, 2004, 09:47 AM
Authorized User
 
Join Date: Dec 2003
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to DolphinBay
Default Chapter 3: Looping through folders error

Good morning,

I am trying to complete the example on page 129 and I am receiving the following error:

An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll

Additional information: Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.

My code reads:

        Dim subFolders() As DirectoryInfo
        subFolders = New DirectoryInfo("c:\").GetDirectories

        Dim subFolder As DirectoryInfo

        For Each subFolder In subFolders
            lstData.Items.Add(subFolder.FullName)

[remainder of code omitted]

Can someone please assist and tell me what this error means?

Thanks in advance.

Eric
 
Old January 23rd, 2004, 10:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jlick
Default

Which line are you getting the error on?

This error in general sounds to me like you have tried to access a folder that your user does not have permission to look at.

It would help if you would supply the values of the Message property, the Source Property, StackTrace Property. You can look at the HelpLink to see if there is any useful information there. The properties listed above will be on the exception object that you received.

If you include this information, we have a much better chance of determining what issue you have.

If the book you are working from has a chapter on exception/error handling, now is probably a good time to read it. :)

On a side note: This is not a forum for the book "Beginning VB.Net", so we may not have access to, or have ever read Chapter 3, page 129. If you describe your problem fully, then we can try to help here. Or for book specific stuff, there is a forum specifically for that book. You can find it on the p2p.wrox.com site the tree to it is:
">All Forums>Books>Beginning VB.NET, 2nd Edition"



John R Lick
[email protected]





Similar Threads
Thread Thread Starter Forum Replies Last Post
paging folders solomon_13000 Classic ASP Professional 1 May 28th, 2006 09:12 AM
Chapter 9 (Looping) Try It Out melbsurfer BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 2 January 27th, 2006 01:54 PM
Which folders to USE groupmatch BOOK: ASP.NET Website Programming Problem-Design-Solution 5 October 7th, 2004 07:52 PM
Parse error in error handler (Chapter 8) Funky Monk BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 August 6th, 2004 08:59 AM
Chapter 3: Looping through folders error DolphinBay BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 2 April 7th, 2004 05:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.