473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Share folder.

Hi All ,
Is there a way to determine whether a folder is being shared with c# ?

Thanks , Itay.

Jan 24 '06 #1
1 1626
Hi,
"Itay" <it***@nur.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi All ,
Is there a way to determine whether a folder is being shared with c# ?


Piece of code ( credit to Willy Denoyette)

using(ManagementClass exportedShares = new
ManagementClass("Win32_Share" ))
using(ManagementClass computer = new
ManagementClass("Win32_computersystem" ))
{
string localSystem = null;
ManagementObjectCollection localComputer = computer.GetInstances();
foreach(ManagementObject mo in localComputer)
{
localSystem = mo["Name"].ToString();
}
ManagementObjectCollection shares = exportedShares.GetInstances();
foreach(ManagementObject share in shares)
// dump UNC path
Console.WriteLine(@"UNC path \\{0}\{1}", localSystem, share["Name"]);
}

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Jan 24 '06 #2

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

Similar topics

4
by: Dave | last post by:
I have an application where I am providing the user the ability to select or create a folder on a domain, using SHBrowseForFolder. When the user selects/creates a folder on a remote computer, it...
1
by: brian.oneil2 | last post by:
Is there a way to install this onto a network file share and allow a team to access it? I would say share a CD from a networked CD drive, but there are multiple CD's that would have to be inserted....
2
by: flat_ross | last post by:
Hi, I am in a shop where developers are required to work off of a network share. This is so that code is backed up nightly. So I am testing running an ASP.NET Web application with a Class...
11
by: ASP.NET User | last post by:
Hi I am in a shop where developers are required to work off of a networ share. This is so that code and other documentation is backed up nightly. This is outside the realm of Visual SourceSafe...
4
by: | last post by:
Hi, Im running IIS and all my data is stored on a network share e.g \\10.0.0.111\domain.com\main The problem i'm facing is that i dont know how to point my aspx.vb files to any dlls in the bin...
4
by: Jeremy S. | last post by:
We're in the process of writing a new Windows Forms app and the desktop support folks want for it to be run from a network share. I know it's possible (i.e., just have the framework on the clients...
3
by: Michel Smit | last post by:
Hello, I have a question. We have a webserver in a domain, DomainA, and a webserver in a DMZ with local users and groups only. I'm trying to copy a file from the DomainA webserver to the DMZ...
2
by: Bill Fallon | last post by:
I have a VS2005 VB.Net windows form application deployed to a share drive. The windows explorer security permissions for this application (.exe) file is set for Everyone with List Folder/Read Data...
0
by: Steve | last post by:
Hello- Platform: - web server using IIS 6 connecting to UNC share on separate file server - Both servers are Windows 2003 with dotNetFramework 2.0 General: - basic ASP.NET pages work fine...
2
by: RN1 | last post by:
Can more than one application (on the same server) share the same Global.asa file? If not, then why? Thanks, Ron
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.