471,047 Members | 1,216 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,047 software developers and data experts.

Enumerating Network Shares

Does anyone have any sample code on enumerating network shares with vb.net.
I here you need to use wither an API or WMI, or are there other


Nov 20 '05 #1
1 3208
If you know the drive letters you could use the following API. Otherwise
you would have to use the WNetEnumResource API call.

Private Declare Function WNetGetConnection Lib "mpr.dll" Alias _
"WNetGetConnectionA" _
(ByVal lpszLocalName As String, _
ByVal lpszRemoteName As String, _
ByRef cbRemoteName As Int32) As Int32
Then use the following code to call this API
Dim y As String
y = Space(100)

WNetGetConnection("Y:", y, 100)

Anand Balasubramanian
Microsoft, Visual Basic .NET

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Homer Blankenship | last post: by
6 posts views Thread by Default User | last post: by
5 posts views Thread by Josh Rolfe | last post: by
2 posts views Thread by Michael | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.