-- 作者:有点甜
-- 发布时间:2014/6/27 18:10:00
--
要引用一下System.management.dll
Dim query As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration") Dim queryCollection As System.Management.ManagementObjectCollection = query.Get() Dim mo As New System.Management.ManagementObject For Each mo In queryCollection If Convert.ToBoolean(mo("ipEnabled")) = True If mo("DefaultIPGateway") IsNot Nothing Then MessageBox.Show( mo("DefaultIPGateway")(0)) End If End If Next
此主题相关图片如下:qq截图20140627180951.png
|