Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6
This is the forum to discuss the Wrox book Beginning Visual Basic 2005 by Thearon Willis, Bryan Newsome; ISBN: 9780764574016
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 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
  #1 (permalink)  
Old April 1st, 2006, 08:58 AM
Registered User
 
Join Date: Apr 2006
Location: Canberra, ACT, Australia.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default My.Computer problem

In chapter 4, while dealing with for each loops, one of the try it out thingies doesnt want to work for me.

The try it out which lists all the folders on C:\ says:
"name 'My' is not declared". Code is as follows:

Code:
Dim strFolder As String
For Each strFolder In My.Computer.FileSystem.GetDirectories("C:\")
'add the item to the list
lstData.Items.Add(strFolder)
Next
Any ideas?

Cheif Wiggum: Alright smart guy, where's the fire?
Homer:       &n bsp;(points to burning police station) Over there.
Cheif Wiggum: Okay, you have just bought yourself a 317; Pointing out police stupidity. Oh wait is that a 314, no 314 is a dog, uh, in, no, is that a 315? Eh you're in trouble pal!
  #2 (permalink)  
Old April 3rd, 2006, 08:31 PM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

I just tried the code you posted any everything works fine. The only thing that comes to mind is that maybe you are using Visual Studio 2003 and not Visual Studio 2005. Can you verify this?

Thearon


Similar Threads
Thread Thread Starter Forum Replies Last Post
Restart computer using c# harshaghanta C# 3 January 5th, 2015 05:23 AM
Problem with code: My.Computer.FileSystem Sporty BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 2 April 23rd, 2007 05:05 AM
Problem with code: My.Computer.FileSystem Sporty Visual Basic 2005 Basics 0 March 14th, 2007 03:52 PM
how do i get computer name shankhan Javascript How-To 0 May 28th, 2005 03:43 PM
computer architecture mole384 C++ Programming 1 February 2nd, 2005 08:24 AM





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