Click here to Skip to main content
15,664,823 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello guys

One of my projects involves maintaining a dynamic index of files grouped according to file types on a sharepoint site . Please help me out guys as to what framework or coding language to use.

1 solution

I don't think you need any other framework above .NET Framework you're already using.

You can collect all files and put them in your data base using System.IO.Directory.GetFiles. You can get all files recursively if you use the parameter System.IO.SearchOption.AllDirectories.

As to grouping, I suggest you devise your data base structure the way it supports all required view it the file system: hierarchical (the way you see it using Windows Shell) and by all kind of tags such as file extension. Please be advised that there is no such notion such file extension from the stand point of the file system (as it used to me in MS-DOS); this is just a part of the file name; however, "extension" in the form of file name ending is supported by the Shell for file type associations (with applications).

More difficult problem is: how to synchronize your index with changes done to the file system? You need to subscribe to all events of all the file system changes such as deletion or creation of files and directories. You can do it using the class System.IO.FileSystemWatcher, see[^].

You will need to dedicate a separate single thread (or maybe a separate process; in this case you should create a Windows Service dedicated to this purpose) used to re-index parts of your file system in response to the notifications from your instance of FileSystemWatcher and update your data base.

That's all you need to know to accomplish your task.

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900