Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
End Users
Pocket PCActiveSyncMultimediaEBooksWirelessSmartPhones
Developers
Windows MobileSmartPhonesWinCE ProgrammingVB for WinCEVC++ for WinCEPlatform BuilderTest Tools
PocketPC DirectoryFree SoftwareWeb Resources
Related Topics
PalmMobile PhonesMore Topics ...

Pocket PC Forum / Developers / VC++ for WinCE / July 2008

Tip: Looking for answers? Try searching our database.

Listing Image Files in C# 2.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tmoraes - 22 Jul 2008 23:05 GMT
Hello Friends
Someone could help me?

I need to write a program that lists all images that are stored in my SD
Card. I need that my program must make a recursive search in my SD.
I'm doing in Visual Studio 2005 in C# CF2.0.
My Device uses Windows CE 5.0
So i using GetFiles but when i run my application an error occurs.

Someone Could help me
Thanks
Regards
Thiago
Paul G. Tobey [eMVP] - 22 Jul 2008 23:19 GMT
"an error occurs".  Well, that's COMPLETELY USELESS.  A well-asked question
gets much better responses...

Paul T.

> Hello Friends
> Someone could help me?
[quoted text clipped - 9 lines]
> Regards
> Thiago
Bruce Eitman [eMVP] - 23 Jul 2008 02:20 GMT
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
tmoraes - 23 Jul 2008 18:51 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.