.NET programming question - accessing network shares

Discussion in 'Archived Threads 2001-2004' started by Chad Ellinger, Jul 19, 2002.

  1. Chad Ellinger

    Chad Ellinger Second Unit

    Joined:
    Jun 18, 2000
    Messages:
    269
    Likes Received:
    0
    I want to write up a little LAN application for myself, and I have come across a seemingly simple function that I can't figure out.

    I want to pull a list of all the available file shares on my LAN. I want to write this app in C# if possible (Java is ok too), and I've looked into the System.Management classes, but I still can't find what I'm looking for.

    Are the any .NET gurus out there that can help me out?
     
  2. Max Leung

    Max Leung Producer

    Joined:
    Sep 6, 2000
    Messages:
    4,611
    Likes Received:
    0
    You can get a list of logical drives using the Directory.GetLogicalDrives method found in the System.IO namespace, although that's probably not what you want unless you can guarantee that all your LAN shares are assigned to a drive letter.

    I guess you'll have to browse the System.IO.Directory and System.IO.DirectoryInfo documentation. Failing that, look at all of System.IO!

    Also try searching Google Groups...
     
  3. Chad Ellinger

    Chad Ellinger Second Unit

    Joined:
    Jun 18, 2000
    Messages:
    269
    Likes Received:
    0
    Thanks Max. I did search through Google Groups, and found some info on the WMI (Windows Management Interface) SDK. I *believe* that System.Management is the .NET implementation of WMI, but I have yet to find any good examples of what I want to do using it.
     

Share This Page