473,442 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I get the names of shared folders in a host ?

is there any function to get the names of shared folders ?

Nov 15 '05 #1
3 9349
You can use the System.Management library (WMI).

ManagementClass objClass = new
ManagementClass("\\\\eurodevssq001\\root\\cimv2:Wi n32_Share");
foreach(ManagementObject objShare in objClass.GetInstances()) {
Console.WriteLine(string.Format("{0} -> {1}",
objShare.Properties["Name"].Value, objShare.Properties["Path"].Value));
}

Check the docs for the Win32_Share management class for other types of
information about the share.
Arild

"Scherbina Vladimir" <vl*********@ukr.net> wrote in message
news:OS**************@TK2MSFTNGP12.phx.gbl...
is there any function to get the names of shared folders ?

Nov 15 '05 #2
Forgot to mention that you replace "eurodevssq001" with whatever server you
want to enumerate shares on.

Arild

"Arild Bakken" <ar*****@hotmail.com> wrote in message
news:uZ*************@TK2MSFTNGP11.phx.gbl...
You can use the System.Management library (WMI).

ManagementClass objClass = new
ManagementClass("\\\\eurodevssq001\\root\\cimv2:Wi n32_Share");
foreach(ManagementObject objShare in objClass.GetInstances()) {
Console.WriteLine(string.Format("{0} -> {1}",
objShare.Properties["Name"].Value, objShare.Properties["Path"].Value));
}

Check the docs for the Win32_Share management class for other types of
information about the share.
Arild

"Scherbina Vladimir" <vl*********@ukr.net> wrote in message
news:OS**************@TK2MSFTNGP12.phx.gbl...
is there any function to get the names of shared folders ?


Nov 15 '05 #3

"Arild Bakken" <ar*****@hotmail.com> wrote in message
news:ex**************@TK2MSFTNGP10.phx.gbl...
Forgot to mention that you replace "eurodevssq001" with whatever server you want to enumerate shares on. No problem, I understood. Thanks. Arild

"Arild Bakken" <ar*****@hotmail.com> wrote in message
news:uZ*************@TK2MSFTNGP11.phx.gbl...
You can use the System.Management library (WMI).

ManagementClass objClass = new
ManagementClass("\\\\eurodevssq001\\root\\cimv2:Wi n32_Share");
foreach(ManagementObject objShare in objClass.GetInstances()) {
Console.WriteLine(string.Format("{0} -> {1}",
objShare.Properties["Name"].Value, objShare.Properties["Path"].Value));
}

Check the docs for the Win32_Share management class for other types of
information about the share.
Arild

"Scherbina Vladimir" <vl*********@ukr.net> wrote in message
news:OS**************@TK2MSFTNGP12.phx.gbl...
is there any function to get the names of shared folders ?



Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Scherbina Vladimir | last post by:
is there any function to get the names of shared folders ?
0
by: Alphonse Giambrone | last post by:
I am building an asp.net web app where a couple of pages will use ssl. It is on a commercial shared host and will utilize a shared ssl certificate. The SSL folder provided is physically on the same...
5
by: Dan Lorenz | last post by:
When trying to use the function CreateDirectory on my local machine everything works fine but when I upload the page to my webhost I get an issue that it can't find path on D:\, though D:\ is what...
1
by: nuggies | last post by:
I'm developing an ASP.NET 2.0 (C#) application in which I need to display the available shared folders on the server. The shared folder paths need to be in UNC format (i.e., \\servername\share)...
3
by: sva | last post by:
Using C# for an application in which I am working on, I need to display the available shared folders on the computer that's running the application. The shared folder paths need to be in UNC format...
1
by: lecnac | last post by:
Sorry for the repost. I must have done something wrong when I tried to post my reply (I can't seem to find it). Anyway, I'd really appreciate any help that anyone could provide. My issue is...
0
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...
2
by: Daniel Knöpfel | last post by:
Hi In my application i need to do the following things concerning shared folders: - check if a folder is shared - share a folder - unshare a folder It seems to me that .net does not...
1
by: JordanRieger | last post by:
Here is a nasty issue that has been giving me grief for the last couple days. This requires good knowledge of IIS, MSXML, and Windows/NTFS permissions. We have an existing ASP (VBScript) app...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.