C# 获得本机IP时间:2022-03-20 16:59:41System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(Environment.MachineName); string strIP = ""; for(int i=0;i<ips.Length;i++) { strIP += ips[i].ToString(); } this.TextBox1.Text = strIP;