dns.GetHostName() 获得不了主机名 一直是null
ArgumentNullException: Argument cannot be null.
Parameter name: hostNameOrAddress
System.Net.Dns.GetHostAddresses (System.String hostNameOrAddress)
UDPServer.Start () (at Assets/Script/UDPServer.cs:30)
dns.GetHostName() 获得不了主机名 一直是null
ArgumentNullException: Argument cannot be null.
Parameter name: hostNameOrAddress
System.Net.Dns.GetHostAddresses (System.String hostNameOrAddress)
UDPServer.Start () (at Assets/Script/UDPServer.cs:30)
原因 已查明 是我的主机名的问题,原理上 主机名如果含特殊符号 GetHostName()是获取不到的,我的主机名一开始是 Zhicheng's Pc 修改为Zhicheng后 顺利获取了主机名