Solved

# Count files in directory in windows phone 8

Posted on 2014-01-10
234 Views
I need linq snippet for count files in directory.
0
Question by:amatic
• 2
• 2

LVL 75

Accepted Solution

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;


There's no perceived benefit from using LINQ to get this information as you'd have to involve these classes anyway.
0

Author Comment

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

Author Comment

ID: 39770873
How to get directory path on Windows Phone??
0

LVL 75

Expert Comment

ID: 39770879
I have to confess that I haven't (yet) written anything for Windows Phone, so I can only go by the documentation:

0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

### Suggested Solutions

Runtime Error 2 28
.Net Web Site IIS Web.Config Content-Security-Policy 1 43
Help with LINQ and XML 10 27
C# guarantee sql connection close 6 25
Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…