C# 中的 Ad-Hoc 无线网络
我想从我的笔记本电脑自动创建一个临时无线网络。 我使用 Windows XP SP3,我想使用 C# 来完成。
我见过一些针对移动设备的库,但我还没有找到针对 PC 的重新分级的库。 有 API 可以做到这一点吗?
谢谢。
I would like to auto-create an ad-hoc wireless network from my laptop.
I use windows XP SP3 and I want to do it using C#.
I have seen some libraries for mobile, but I havent found something regrading PC.
Is there an API to do that ?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Ad-hoc 网络通常用于普适计算(智能家居)。对于笔记本电脑,这取决于您想要连接的设备,因为 ad-hoc 通常适用于您控制的许多设备。
可能您的意思是连接到任何可以连接的网络,在这种情况下,它更多地在操作系统级别。
Ad-hoc network are usually used in Ubiquitous Computing (smart homes). For a laptop, it depends what you'd like to connect to, as ad-hoc usually work with many devices you control.
May be you mean connecting to whatever network you can, in which case it's more on the OS-level.
如果您愿意在网络上设置一台机器作为无线服务器并放弃 Ad Hoc,那么 codeplex 上的托管 Wifi API 看起来非常有前途。它是用 C# 编写的,可以在 XP SP3 及更高版本上运行(还有一点在 SP2 上,仅供参考)。 http://managementwifi.codeplex.com/
它使用 Microsoft 的 Native Wifi API。 Native Wifi API 要求您拥有一台服务器计算机,它将向连接到您创建的网络的其他设备分发私有 IP。在本机 Wifi 中,您需要独立模式 ICS 来创建您的网络(如果您希望在网络上访问互联网,则使用完整的 ICS)。
http://msdn.microsoft。 com/en-us/library/windows/desktop/dd815252(v=vs.85).aspx
不过,使用本机 Wifi 作为参考,托管 Wifi API 正是您需要的 C# 功能。
If you are willing to setup one machine on the network as a wireless server and forgo Ad Hoc, then the Managed Wifi API on codeplex looks very promising. It is in C# and works on XP SP3 and higher (and a little bit on SP2, fyi). http://managedwifi.codeplex.com/
It uses the Native Wifi API from Microsoft. The Native Wifi API requires you to have a server machine which will hand out private IPs to other devices that connect to the network you create. In Native Wifi you would want StandAlone mode ICS in order to create your network (if you want internet access on your network use full ICS then).
http://msdn.microsoft.com/en-us/library/windows/desktop/dd815252(v=vs.85).aspx
Use the Native Wifi as just a reference though, Managed Wifi API is what you will want for C#.
其实我对这个也很感兴趣。我认为这可能有用:
http://msdn.microsoft.com/en- us/library/ms705973(v=vs.85).aspx
不幸的是,我相信这仅适用于 Windows 7 和 Windows Server 2008。
我不懂 C#,但如果我懂,那可能就有意义了。如果您发现任何见解,请与我联系,我也想学习如何做到这一点。
I'm interested in this too actually. I think this could be useful:
http://msdn.microsoft.com/en-us/library/ms705973(v=vs.85).aspx
Unfortunately, this is only available for Windows 7 and Windows Server 2008 I believe.
I don't know any c#, but if I did, it'd probably make sense. If you find any insight, please contact me, I'd also like to learn how to do this as well.