Get List of Sharing Folder using C#.net

Posted by Naraayanan under C# on 9/14/2012 | Points: 10 | Views : 3595 | Status : [Member] | Replies : 4
Hi ,
How to check list of Share folders in the Local System using C#.Net and also User Permission (like Allow Network Users Changes this File(s)) ?

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/



Responses

Posted by: Seng2hs on: 10/23/2012 [Member] Starter | Points: 25

Up
0
Down
public List<string> GetShareNames()
{
List<string> shares = new List<string>();
try
{
using (ManagementObjectSearcher query = new ManagementObjectSearcher(new SelectQuery("Win32_ConnectionShare")))
{
foreach (ManagementObject obj in query.Get())
{
using (ManagementObject antecedent = new ManagementObject(obj["Antecedent"].ToString()))
{
using (ManagementObject dependent = new ManagementObject(obj["Dependent"].ToString()))
{
shares.Add(dependent["Name"].ToString());
}
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
return shares;
}

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Taruna on: 10/23/2012 [Member] Starter | Points: 25

Up
0
Down
hello

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 10/23/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

Taruna what hello post your answer here this is question and answer share with knowledge subject related so.

Mark as Answer if its helpful to you

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naraayanan on: 10/25/2012 [Member] Starter | Points: 25

Up
0
Down
HI,
Thanks .

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response