连接到.NET C++;应用 我在C++开发了一个Windows窗体应用程序,并且尝试连接到无线网络,检索网络状态的细节,比如SSID和连接。我试图研究wininet,但该库似乎不提供本地网络功能。做这件事最简单的方法是什么?任何帮助都会非常感谢。 < P>使用Boost C++库进行连接,它提供了网络编程的类,Boost Asio是具体的。
示例代码段:连接到.NET C++;应用 我在C++开发了一个Windows窗体应用程序,并且尝试连接到无线网络,检索网络状态的细节,比如SSID和连接。我试图研究wininet,但该库似乎不提供本地网络功能。做这件事最简单的方法是什么?任何帮助都会非常感谢。 < P>使用Boost C++库进行连接,它提供了网络编程的类,Boost Asio是具体的。,.net,winforms,c++-cli,wifi,.net,Winforms,C++ Cli,Wifi,示例代码段: asio::ip::tcp::socket socket(io_service); // Do all your accepting and other stuff here. asio::ip::tcp::endpoint remote_ep = socket.remote_endpoint(); asio::ip::address remote_ad = remote_ep.address(); std::string s = remote_ad.to_string();
asio::ip::tcp::socket socket(io_service);
// Do all your accepting and other stuff here.
asio::ip::tcp::endpoint remote_ep = socket.remote_endpoint();
asio::ip::address remote_ad = remote_ep.address();
std::string s = remote_ad.to_string();
单线转换:
asio::ip::tcp::socket socket(io_service);
// Do all your accepting and other stuff here.
std::string s = socket.remote_endpoint().address().to_string();
我不确定它针对您的查询提供的功能,但肯定是网络编程的最佳选择之一。我没有使用任何与SSID有关的东西
PS:Boost提供跨平台支持。< /P>你使用开源库(如Boost C++或LIbCURL)吗?不,但我会开放的。试试Boost C++,它是开源的,而且容易做,你可以在文档中找到代码片段。你指的是“连通性”究竟指什么??@WillisZawisa.NET语言易于互操作。但是,C++/CLI被用作托管代码和本机代码之间的互操作层。使用它来构建一个完整的应用程序将是一件痛苦的事情。如果你选择它是因为你知道C++,那么就坚持C++。如果你愿意使用不同的语言,C语言将更适合UI开发。