"an error occurs". Well, that's COMPLETELY USELESS. A well-asked question
gets much better responses...
Paul T.
And of course a newsgroup focused on C# and/or the Compact Framwork would be
a better place to ask C# questions than a C++ newsgroup.

Signature
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman
EuroTech Inc.
www.EuroTech.com
> "an error occurs". Well, that's COMPLETELY USELESS. A well-asked
> question gets much better responses...
[quoted text clipped - 14 lines]
>> Regards
>> Thiago
OK sorry about this.
So here my code for search JPG and BMP files in Strage Card:
private void button1_Click(object sender, EventArgs e)
{
String[] files = Directory.GetFiles(@"\\Storage Card",
"*.jpg;*.bmp");
foreach (String file in arquivos)
{
Console.WriteLine("Found: " + Path.GetFileName(files));
}
And this is an Error:
Error
IOException
at System.IO._Error.WinIOError()
at System.IO.Directory.InternalGetFileDirectoryNames()
at System.IO.Directory.InternalGetFiles()
at System.IO.Directory.GetFiles()
at PRD.PRDInterface.button1_click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProck()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at PRD1.Program.Main()
Thanks
Regards
Thiago
> "an error occurs". Well, that's COMPLETELY USELESS. A well-asked question
> gets much better responses...
[quoted text clipped - 14 lines]
> > Regards
> > Thiago
Paul G. Tobey [eMVP] - 23 Jul 2008 19:40 GMT
OK, so catch the IOException and look at the error code given therein. That
should tell you what the call is trying to tell you. I don't get that in
some simple tests that I've run, so I'm inclined to guess that there's no
Storage Card folder.
The one thing that I did find after trying this myself is that your search
string won't work. You don't seem to be able to list multiple wildcard
specifications for several extensions. If you want to find *.jpg and *.bmp,
search for each one in turn.
Paul T.
> OK sorry about this.
>
[quoted text clipped - 48 lines]
>> > Regards
>> > Thiago
Paul G. Tobey [eMVP] - 23 Jul 2008 19:48 GMT
And sure enough, there's the problem. You're using @ quoted strings which
don't process the escape characters so you have two \\ characters at the
beginning of the path, which doesn't make sense.
Paul T.
> OK, so catch the IOException and look at the error code given therein.
> That should tell you what the call is trying to tell you. I don't get
[quoted text clipped - 60 lines]
>>> > Regards
>>> > Thiago