2

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!

Fred Foo
  • 342,876
  • 71
  • 713
  • 819
Aaaaaaaa
  • 1,885
  • 3
  • 19
  • 38

2 Answers2

3

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++:

Check out this question

There's also this MSDN article, using PathFileExists which should do for C.

Community
  • 1
  • 1
Alex
  • 7,643
  • 1
  • 40
  • 54
1

In C++/C# you can use the following windows API's NetShareEnum() and NetShareGetInfo()

Check MSDN for the details.

gnuanu
  • 2,242
  • 3
  • 28
  • 42