Unity获取IOS设备ipv4地址

ios

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System.Net;
using System.Net.Sockets;

public class GetIPAddress : MonoBehaviour
{
public string GetIP()
{
string ipAddress = "";
IPHostEntry host;
host = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
ipAddress = ip.ToString();
break;
}
}
return ipAddress;
}
}

Unity获取IOS设备ipv4地址
https://blog.966677.xyz/2025/03/02/Unity获取IOS设备ipv4地址/
作者
Zhou1317fe5
发布于
2025年3月2日
许可协议