How can I check in C# whether a directory is shared? And is it done in C/C++ under Windows?
The directory is on the same PC!
How can I check in C# whether a directory is shared? And is it done in C/C++ under Windows?
The directory is on the same PC!
As for C#: To check wether you can access (read access at least) a network share / unc path with the current logged in user, do a IO.Directory.Exists(@"\\YourUNCShare")
For C++:
There's also this MSDN article, using PathFileExists
which should do for C
.
In C++/C# you can use the following windows API's NetShareEnum() and NetShareGetInfo()
Check MSDN for the details.