static void Main(string[] args){IPAddress[] ips = Dns.GetHostAddresses("");foreach (var ipAddress in ips){Console.WriteLine(ipAddress);   }Console.ReadLine();}<span style="white-space:pre">      </span>
首先单独运行了一下
<img src="https://img-blog.csdn.net/20150508165409584?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzI5MTMzNw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
有ip6,有ip4
原代码中关于ip的是这样
客户端
 IPAddress[] serverIp = Dns.GetHostAddresses("");
tbxSrvIp.Text = serverIp[0].ToString();
tbxSrvIp.SelectAll();
tbxPort.Text = "1888";
服务器端
   IPAddress[] listenIp = Dns.GetHostAddresses("");
localAddress = listenIp[0];
————————————————————————————————————————————————————
我把0改成2,也就是v4,就可以了。
具体原因不太懂。
<img src="https://img-blog.csdn.net/20150508165733102?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzI5MTMzNw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />

No connection could be made because the target machine actively refused it 192.168.131.196:1888相关推荐

  1. 解决grpc连接报错connectex: No connection could be made because the target machine actively refused it

    如有帮助,欢迎留下足迹哦! 详情如下 code = Unavailable desc = connection error: desc = "transport: Error while d ...

  2. Redis错误:No connection could be made because the target machine actively refused it

    问题: 利用go连接远程阿里云centos主机的redis,代码如下: redisCli := redis.NewClient(&redis.Options{Addr: url,Passwor ...

  3. connectex: No connection could be made because the target machine actively refused it.

    关于阿里云服务器出现以下错误的原因: connectex: No connection could be made because the target machine actively refuse ...

  4. consul注册报错 connectex: No connection could be made because the target machine actively refused it.

    consul注册报错 connectex: No connection could be made because the target machine actively refused it. Ge ...

  5. No connection could be made because the target machine actively refused it [::1]:808

    No connection could be made because the target machine actively refused it [::1]:808 1.首先查看端口占用情况, 在 ...

  6. 关于docker报错:No connection could be made because the target machine actively refused it.

    我是在win10下跑的docker 事情是这样的,今天安装好douker跑起来后报了一个很奇怪的错误` C:\Users\Administrator>docker ps error during ...

  7. VS Test: No connection could be made because the target machine actively refused it 127.0.0.1:6910

    问题: 在做web测试和负载测试时,突然所有的测试有例都不能用了.显示错误:No connection could be made because the target machine activel ...

  8. grpc client No connection could be made because the target machine actively refused it

    grpc client No connection could be made because the target machine actively refused it 禁用防火墙 查看yaml中 ...

  9. nginx connect()错误(10061: No connection could be made because the target machine actively refused it)

    nginx偶尔会报下面这个错误: 2019/05/20 10:54:56 [error] 717920#661892: *16943633 connect() failed (10061: No co ...

最新文章

  1. 关于数据库SQL优化
  2. 提高 Java 代码质量
  3. 微信小程序前端支付代码
  4. 小程序原生组件调用mpvue父组件方法
  5. 云漫圈 | 革命版互联网公司虐恋大戏,周一拿去怼业务!
  6. android 小学课程,小学课堂(小学学习软件)
  7. [Hadoop in China 2011] 淘宝OceanBase打造结构化NoSQL数据库
  8. mysql服务器的字符集
  9. STM32开发环境安装
  10. zuma解析:SEO网站跳出率
  11. bzoj1753[Usaco2005 qua]Who's in the Middle*
  12. win2019微软更新服务器,将 Windows Server 2016 升级到 Windows Server 2019
  13. Discuz论坛如何使用SendCloud?
  14. 什么是高防服务器,高防服务器的原理
  15. 宿州计算机学院录取分,考多少分才能上宿州学院 录取分数是多少
  16. 嵌入式 linux ramdisk 保存文件,制作嵌入式linux文件系统(ramdisk,cramfs,squashfs)...
  17. GCC源码分析(十六) — gimple转RTL(pass_expand)(下)
  18. cia在计算机术语是什么意思,考生必看:国际内审师CIA考试的六大特点
  19. 两秒17发——一个鼠标连点器
  20. 天秀,“手机” 也可以写Python代码了!

热门文章

  1. 列主元素消去法的Matlab实现
  2. Mac上如何提取图片上的文字?
  3. Java期末考试试题及参考答案(06)
  4. python-分分钟入门-基础语法
  5. list对象转map stream /去重( 根据属性转Map或者分组)
  6. access vba表字段_ACCESS VBA编程(使用技巧大全)[].doc
  7. ROS Navigation Stack安装
  8. RabbitMQ消息队列(一): Detailed Introduction 详细介绍
  9. puppy linux php,硬盘/U盘安装Puppy Linux方法
  10. 一个想法:成立草根技术联盟对开发人员进行技术定级解决企业员工招聘难问题!