Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Count files in directory in windows phone 8

Posted on 2014-01-10
4
Medium Priority
?
254 Views
Last Modified: 2016-02-10
I need linq snippet for count files in directory.
0
Comment
Question by:amatic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 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 75

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

PowerShell Core for Advanced Linux Administrators

Understand advanced principals around Powershell Core with a focus on the Linux Administrator.  This course covers how to administer numerous environments across multiple platforms including Linux, Azure, AWS, and Google Cloud from a single shell instance.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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 …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

721 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