472,950 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,950 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 3294
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Homer Blankenship | last post by:
Every day we get several errors like or similar to this one while a ..net app is trying to write files to a network share. The .net app breaks the files up into chunks and writes them to this share...
by: Michael C | last post by:
Hi all, After a lot of research, I've come to some realizations about enumerating Named Instances of MSDE. NetServerEnum() Win32 API function doesn't work, SQL-DMO doesn't work, no standard...
by: Default User | last post by:
Hi How can i look for network share folders and copy a text file to it? I've been looking into how i can do this in the documention but with no luck. I found a little on of the web but i dont...
by: Josh Rolfe | last post by:
I have a page in classic asp that accces a network drive, The code is as follows: <% dim fso dim objFolder set fso=server.createObject("Scripting.FileSystemObject") set...
by: Phil Galey | last post by:
Is there any way of enumerating all printers, including network printers in VB.NET? printing.PrinterSettings.InstalledPrinters only enumerates printers attached to the local workstation. ...
by: Michael | last post by:
We have an ASP.NET 2.0 web application running on a Windows 2003 domain controller. Part of that application needs to read and write files from and to a network share ( living on a MAC Xserveraid)...
by: tendim | last post by:
G'day group. Currently our organization us using VB6 based applications, and I am trying to push forward and migrate some of the smaller things to VB.NET, eventually migrating all applications...
by: NoWhereMan | last post by:
Hello, I'm trying to get the list of shared folders of a network computer and add them to a combo box. I'm using the bellow code in VB .NET. Code ==== Private Sub EnumShares(ByVal Machine As...
by: lmttag | last post by:
ASP.NET 2.0 (C#) application Intranet application (not on the Internet) Using Windows authentication and impersonation Windows Server 2003 (IIS6) Server is a member server on a domain Logged...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...

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.