void LogIpAddressAndMobileIP() { if (string.IsNullOrEmpty(networkUrl)) { return; } string wwwUrl = ""; try { wwwUrl = networkUrl.Replace("http://", ""); wwwUrl = wwwUrl.Substring(0, wwwUrl.IndexOf("/")); Logger.Info("networkIpv4 " + NetInfo.GetIPAddress(wwwUrl) + " playerIp: " + MobileInfo.GetMobileCurrentIPv4()); } catch (Exception e) { Logger.Error("解析url ip地址失败或获取玩家ip信息失败! wwwUrl为:" + wwwUrl + " 错误信息:" + e.Message); } }