Count files in directory in windows phone 8

I need linq snippet for count files in directory.
amaticAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
käµfm³d 👽Connect With a Mentor Commented:
Based on what I see in the documentation, you should be able to use either the Directory class or DirectoryInfo class to determine this.

e.g.

DirectoryInfo dir = new DirectoryInfo(@"path\to\folder");
int fileCount = dir.GetFiles().Length;

// OR

fileCount = Directory.GetFiles(@"path\to\folder").Length;

Open in new window


There's no perceived benefit from using LINQ to get this information as you'd have to involve these classes anyway.
0
 
amaticAuthor Commented:
Are you sure that will working on Windows Phone???
0
 
amaticAuthor Commented:
How to get directory path on Windows Phone??
0
 
käµfm³d 👽Commented:
I have to confess that I haven't (yet) written anything for Windows Phone, so I can only go by the documentation:

Screenshot
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.