Search code examples
c#.netnetwork-programmingfile-sharingnetwork-share

How do I list a computer's remotely shared files using C#?


How do I list a computer's remotely shared files using C#?

Could someone help me with this?

[Update]: Done it by exe "NET VIEW" command in C# code finally.


Solution

  • I'd look at the Win32_Share WMI class. If you haven't used WMI from C# before, this codeproject article should show you how to get started: Howto: (Almost) Everything in WMI via C# - Part 1: Registry

    This Technet article has a sample VBScript for enumerating shared: Enumerating Shared Folders
    Just change strComputer in that sample to be the computer you're interested in.