private void ReadPhotos()
{
DirectoryInfo folder = new DirectoryInfo( photoPath );
//遍历文件
foreach( FileInfo file in folder.GetFiles( "*.jpg" ) )
{
string name = file.Name;
photoList.Add( name );
}
}
GetFiles()函数,可以使用通配符也可以为空。