Quantcast
Channel: Silverlight 5 forum
Viewing all articles
Browse latest Browse all 1083

How to read filenames in a folder in my silverlight project (locally)?

$
0
0

I am creating a silverlight web application and in it I am trying to read pdf file names stored in a local folder and display them in list box while clicking a button. The folder is under my silverlight project folder. when I tried below code

List<string> list = new List<string>();

DirectoryInfo dInfo = new DirectoryInfo(@"c:\..........");//your path
 FileInfo[] FilesList = dInfo.GetFiles();//can filter here with appropriate extentions
 foreach(FileInfo fi in FilesList)
 {
     list.add( fi.Name);      
 }

it is giving me errors like "file operation not permitted. access to path is denied."

Please help me as I am new to silverlight. Also let me know if it is feasible or not in silverlight.


Viewing all articles
Browse latest Browse all 1083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>