以编程方式创建或加入家庭组
我正在尝试编写一个实用程序来引导用户连接和设置他们的网络。我的一个要求是创建或加入一个家庭组。我已经能够找到 IHomeGroupProvider .JoinHomeGroup
或 HomeGroupManager.JoinHomeGroup
但我不知道如何获取 IHomeGroupProvider
的实例。它看起来像在 wsshomegroupobjectmodel.dll
中,但我不确定这是否只在 Windows Server 中可用,或者如何在 Windows 7 中进入那里。
我想我需要创建一个 实例>HomeGroupManager
,但同样,我不知道从哪里获取 DLL。
I am trying to write a utility to walk users through connecting and setting up their network. One requirement I have is to create or join a home group. I have been able to find IHomeGroupProvider.JoinHomeGroup
or HomeGroupManager.JoinHomeGroup
but I don't know how to get an instance of IHomeGroupProvider
. It looks like its in wsshomegroupobjectmodel.dll
, but I am not sure if that is only available in windows server or how to get in there in Windows 7.
I think I need to create an instance of HomeGroupManager
, but again, I don't know where to get the DLL.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我没看错的话,我认为 这篇 MSDN 文章 说“Windows Server Solutions SDK”与 Windows Server 2008 R2 SDK 打包在一起,可以下载 这里。
安装完成后,您应该能够使用
HomeGroupManager.JoinHomeGroup
而无需管理IHomeGroupProvider
实例。If I am reading it right, I think this MSDN article says that the 'Windows Server Solutions SDK' is packaged in with the Windows Server 2008 R2 SDK which can be downloaded here.
Once you've got that installed you should be able to use
HomeGroupManager.JoinHomeGroup
without having to manage aIHomeGroupProvider
instance.