Wrox Programmer Forums
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 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 April 20th, 2007, 07:07 AM
Registered User
 
Join Date: Apr 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default "Name My ": declaretion error

Hi all

I very new programer of vb2005.Please someone help me out.
I want to display all the folders of "C:\" drive in a list box(lstbox1) using my.computer.filesystem.getdirectories("C:\") as written below .While compiling this code error massage coming "Name My not declared .." pls guid for each strfoler as string in my.computer.filesystem.getdirectories("C:\")
lstbox1.item.add(strfolder)
next

Thanks
Ajay Kumar

ajay
 
Old April 20th, 2007, 08:39 AM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Code:
Imports System
Imports System.IO
Code:
ListBox1.DataSource = Directory.GetFiles("C:\")
Have a nice day
http://yulyos4vbnet.spaces.live.com
 
Old April 20th, 2007, 09:20 AM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Your code it's also good you just did a spelling mistake.
Code:
For Each strfoler As String In My.Computer.FileSystem.GetDirectories("C:\")
  ListBox1.Items.Add(strfolder)
Next

Have a nice day
http://yulyos4vbnet.spaces.live.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
Ch 4: Parse error: syntax error, unexpected T_SL hanizar77 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 23rd, 2008 09:17 PM
[Resolved] Error calling a sp - parameter error snufse .NET Framework 2.0 2 February 12th, 2008 04:46 PM
Parse error: syntax error, unexpected T_STRING ginost7 Beginning PHP 1 November 9th, 2007 02:51 AM
Phile Page error, visual studio error reps BOOK: ASP.NET Website Programming Problem-Design-Solution 0 September 27th, 2003 10:11 AM





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