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!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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
PathFileExistswhich should do forC.