Windows / C ++:如何确定与共享驱动器相关联的共享名? [英] Windows/C++: How do I determine the share name associated with a shared drive?
本文介绍了Windows / C ++:如何确定与共享驱动器相关联的共享名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我有一个驱动器,例如 C:\ ,我想知道它是否共享,以及它的共享名称(例如 C $ )是
Let's say I have a drive such as C:\, and I want to find out if it's shared and what it's share name (e.g. C$) is.
要确定是否共享,可以使用 NetShareCheck 。
To find out if it's shared, I can use NetShareCheck.
如何将驱动器映射到其共享名?我认为 NetShareGetInfo 会做到这一点,但
How do I then map the drive to its share name? I thought that NetShareGetInfo would do it, but it looks like that takes the share name, not the local drive name, as an input.
推荐答案
如果所有其他方法都失败了,可以总是使用NetShareEnum和每个呼叫NetShareGetInfo。
If all else fails, you could always use NetShareEnum and call NetShareGetInfo on each.
这篇关于Windows / C ++:如何确定与共享驱动器相关联的共享名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文