View Network Shares

tready

New member
Joined
Dec 2, 2005
Messages
4
Programming Experience
1-3
Hello,

I'm a web developer for my company and my network admin asked if I could develop an app that would show all network shares and information about those shares. The information being whatever is available. Has anyone developed anything like this? Can anyone point me in the rght direction? I'm not even sure of what to google. I use to program in VB 6, but all I can get here is the free version from Microsoft, Visual Basic Express. If someone could help that would be great.
 
There is no native support for this kind of operation in the .Net Framework, closest is WMI, but that's still fairly new too and may not be supported by the pletory of OS on the network.

Your best bet is the WNetOpenEnum, WnetEnumResource and WNetCloseEnum Win32 API set. You'll find info about this in the Platform SDK docs and online too at MSDN here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wnet/wnet/windows_networking_reference.asp (for hidden shares you got NetShareEnum, good luck on that one!)

I found one managed implementation of this at The Code Project (in C#) http://www.codeproject.com/csharp/csenumnetworkresources.asp
 
I'm completely lost when it comes to C#. I can't even get that sample to run right. I complie it and get a dos screen and can't type anything into the window. Also no cursor.
 
Well, there are C#/VB.Net converters (here is one online I was tipped of http://www.developerfusion.co.uk/utilities/). Also with the info about what functions to use you may be able to find some examples in for you more familiar VB6 too. The Win32 API resources is used the same way they were in VB6. Still nowhere near as user friendly as native .Net Framework functionality, we can only wait for that toolbox to expand.
 
Back
Top