468,512 Members | 1,429 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

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
recomendations.

Thanks

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

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)
MsgBox(y)


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
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.