IPHostEntry localHostEntry = Dns.GetHostByName(Dns.GetHostName());
for(int i=0;i<localHostEntry.AddressList.Length;i++)
{
cmbIP.Items.Add(localHostEntry.AddressList[i].ToString()); //把本机所有网卡(如:双网卡)的IP地址列出来
}
为什么我的程序会报错 cmbIP 不存在呢
for(int i=0;i<localHostEntry.AddressList.Length;i++)
{
cmbIP.Items.Add(localHostEntry.AddressList[i].ToString()); //把本机所有网卡(如:双网卡)的IP地址列出来
}
为什么我的程序会报错 cmbIP 不存在呢
cmbIP.Items.Add(localHostEntry.AddressList[i].ToString());
这个就是往combobox添加项