IP
首先引用:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Net;
首先引用:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Net;
System.Net.IPAddress[] addlist
=
System.Net.Dns.GetHostByName(Dns.GetHostName()).AddressList;
// Dns.GetHostName()获得主机名
for ( int i = 0 ; i < addlist.Length;i ++ )
... {
str+=addlist[i].ToString();
}
MessageBox.Show(str);
System.Net.Dns.GetHostByName(Dns.GetHostName()).AddressList;
// Dns.GetHostName()获得主机名
for ( int i = 0 ; i < addlist.Length;i ++ )
... {
str+=addlist[i].ToString();
}
MessageBox.Show(str);