Determining if a folder is shared in .NET

.net, c#, windows

Solution

You can use WMI Win32_Share. Take a look at:

http://www.gamedev.net/community/forums/topic.asp?topic_id=408923

Shows a sample for querying, creating and deleting shared folders.

Problem

Is there a way through the .net framework to determine if a folder is shared or not? Neither Diretory, DirectoryInfo or FileAttributes seem to have any corresponding field. One thing I forgot to mention was that I want to be checking for network shares. But I'll investigate the WMI stuff.

Original source