Hi Ryan,
Do you means you want to programly get a reference to a certain UNC shared
folder via its path and then enumerate all the files under that folder and
store all those files' fullpath into db?
If so, I think we can use the System.IO.DirectoryInfo class to get a UNC
folder's info (as long as that folder has shared with the appropriate
privilage).
For example:
the following code print out all the files's Full path under a give UNC
shared dir.
static void EnumUNCFolder(string uncpath)
{
DirectoryInfo di = new DirectoryInfo(uncpath);
if(di != null)
{
FileInfo[] files = di.GetFiles();
Console.WriteLine(di.FullName + " " + di.CreationTimeUtc);
for(int i=0;i<files.Length;i++)
{
Console.WriteLine("@ " + files[i].Name + " " + files[i].CreationTimeUtc);
}
}
}
we can use it like EnumUNCFolder(@"\\servername\shareddir")
HOpe helps. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)