* 在使用前,一定要注意在头部加上引用: using System.Net; 代码如下: using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Console.Write(new P…
使用函数getifaddrs来枚举网卡IP,当中使用到的结构体例如以下所看到的: struct ifaddrs { struct ifaddrs *ifa_next; /* Next item in list */ char *ifa_name; /* Name of interface */ unsigned int ifa_flags; /* Flags from SIOCGIFFLAGS */ struct sockaddr *ifa_addr; /* Address of interfa…
使用 Azure 经典管理门户中创建的虚拟机,无法使用静态IP 地址,在管理界面没有该设置.在新的管理门户中虽然有使用静态IP的设置,但是选项是灰色,无法修改,提示错误:This virtual machine can't be configured with a static private IP address because it's not deployed in a virtual network. 默认情况下,Azure中的虚拟机关机后重启,会重新分配IP地址.生产环境中,为了和其它…