Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: String array declaration
|
Posted: Jun 14, 2003 4:58 PM
|
|
You didn't give the line number for the compiler error and the code you have posted here seems to be okay, so the error maybe coming from some other part of your code.
FYI, here are some tricks that might help you with your app: You can use the DirectoryInfo object (you need to import System.IO, or fully reference it as System.IO.DirectoryInfo) to get all the files of a certain type in a folder (or simply all the files, if you want). You can also get the "My Pictures" folder from the Environment object. Here's an example of how you would use these if your object wanted to get thumbnails for all the jpg files in the "My Pictures" folder (assuming your object implements the "AddThumbnail()" method):
import System; // Has Environment object.
import System.IO; // Has of DirectoryInfo and FileInfo.
// ...
string myPix = Environment.GetFolderPath( Environment.SpecialFolder.MyPictures );
DirectoryInfo myPixInfo = new DirectoryInfo( myPix );
foreach( FileInfo pic in myPixInfo.GetFiles( "*.jpg" ) )
AddThumbnail( pic.FullName );
|
|