Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
IP address取得
string targetSheet = "IP address取得";
if (GUILayout.Button(targetSheet, GUI.skin.button, GUILayout.Width(150), GUILayout.Height(30)))
{
// ホスト名を取得する
string hostname = Dns.GetHostName();
Debug.Log("hostname=" + hostname);
// ホスト名からIPアドレスを取得する
IPAddress[] adrList = Dns.GetHostAddresses(hostname);
foreach (IPAddress address in adrList)
{
Debug.Log(address.ToString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.