Solved

Count files in directory in windows phone 8

Posted on 2014-01-10
4
229 Views
Last Modified: 2016-02-10
I need linq snippet for count files in directory.
0
Comment
Question by:amatic
  • 2
  • 2
4 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39770866
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
 

Author Comment

by:amatic
ID: 39770870
Are you sure that will working on Windows Phone???
0
 

Author Comment

by:amatic
ID: 39770873
How to get directory path on Windows Phone??
0
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 39770879
I have to confess that I haven't (yet) written anything for Windows Phone, so I can only go by the documentation:

Screenshot
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now