您好,欢迎来到赴品旅游。
搜索
您的当前位置:首页c++无法获取本地ip地址

c++无法获取本地ip地址

来源:赴品旅游

可以使用ipconfig列出它们。#include
#include
voidtrimstring(std::string&str)
{
if(!str.empty())
{
str.erase(0,str.find_first_not_of(""));
str.erase(str.find_last_not_of("")+1);
}
}
std::stringgetlocalip()
std::string
ip"127.0.0.1");
std::stringipconfig_content;
FILE*fp=_popen("ipconfig","r");
if(NULL!=fp)
{
charline[4096];
while(NULL!=fgets(line,sizeof(line)。

Copyright © 2019- fupindai.com 版权所有 赣ICP备2024042792号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务