windows网卡解析 网络适配器转Java对象

前段时间因为工作需要,写一个小工具,给终端用户设置DNS,由于是通过Java的GUI框架编写的界面程序,因此也需要使用Java来获取网络适配器信息,并转为JavaBean,花了点时间写了个解析语句,请大家参考。

1、网络连接基础信息

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 网络连接基础信息
 * @author musj
 *
 */
public class NetworkBasic {

	private String hostName;
	private String mainDnsSuf;
	private String nodeType;
	private String ipRouteInvocation;
	private String winsAgentInvocation;
	/**
	 * DNS 后缀搜索列表
	 */
	private String dnsSufSerchList;
	private Map<String, NetworkBean> netLinks = new LinkedHashMap<String, NetworkBean>();
	
	private static String NEW_LINE = "\r\n";
	
	public String getHostName() {
		return hostName;
	}
	public void setHostName(String hostName) {
		this.hostName = hostName;
	}
	public String getMainDnsSuf() {
		return mainDnsSuf;
	}
	public void setMainDnsSuf(String mainDnsSuf) {
		this.mainDnsSuf = mainDnsSuf;
	}
	public String getNodeType() {
		return nodeType;
	}
	public void setNodeType(String nodeType) {
		this.nodeType = nodeType;
	}
	public String getIpRouteInvocation() {
		return ipRouteInvocation;
	}
	public void setIpRouteInvocation(String ipRouteInvocation) {
		this.ipRouteInvocation = ipRouteInvocation;
	}
	public String getWinsAgentInvocation() {
		return winsAgentInvocation;
	}
	public void setWinsAgentInvocation(String winsAgentInvocation) {
		this.winsAgentInvocation = winsAgentInvocation;
	}
	
	public void addNetworkBeah(String name, NetworkBean bean) {
		this.netLinks.put(name, bean);
	}
	
	public String getDnsSufSerchList() {
		return dnsSufSerchList;
	}
	public void setDnsSufSerchList(String dnsSufSerchList) {
		this.dnsSufSerchList = dnsSufSerchList;
	}
	public Map<String, NetworkBean> getNetLinks() {
		return netLinks;
	}
	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer(NEW_LINE).append("------Windows IP 配置------").append(NEW_LINE);
		sb.append("主机名:\t\t").append(this.hostName).append(NEW_LINE)
			.append("主 DNS 后缀:\t\t").append(this.mainDnsSuf).append(NEW_LINE)
			.append("节点类型:\t\t").append(this.nodeType).append(NEW_LINE)
			.append("IP 路由已启用:\t\t").append(this.ipRouteInvocation).append(NEW_LINE)
			.append("WINS 代理已启用:\t\t").append(this.winsAgentInvocation).append(NEW_LINE);
			if(this.dnsSufSerchList != null) {
				sb.append("DNS 后缀搜索列表:\t\t").append(this.dnsSufSerchList).append(NEW_LINE);
			}
		if(this.netLinks != null && this.netLinks.size() > 0) {
			String key = null;
			for(Iterator<String> it = this.netLinks.keySet().iterator(); it.hasNext();) {
				sb.append(NEW_LINE);
				key = it.next();
				sb.append("------").append(key).append("------").append(NEW_LINE);
				sb.append(this.netLinks.get(key).toString());
			}
		}
		return sb.toString();
	}
}

2、具体某个网卡信息

import java.util.List;

/**
 * 网络连接bean
 * @author musj
 *
 */
public class NetworkBean {
	
	private static String NEW_LINE = "\r\n";
	/**
	 * IPv4 地址 
	 */
	private String ipv4Addr;
	/**
	 * IPv6 地址 
	 */
	private String ipv6Addr;
	/**
	 * 临时 IPv6 地址
	 */
	private String ipv6AddrTmp;
	/**
	 * 本地链接 IPv6 地址
	 */
	private String ipv6AddrLocal;
	/**
	 * 获得租约的时间
	 */
	private String leaseGetTime;
	/**
	 * 租约过期的时间 
	 */
	private String leaseTimeout;
	/**
	 * 描述
	 */
	private String description;
	/**
	 * 物理地址
	 */
	private String mac;
	/**
	 * DHCP 已启用
	 */
	private String dhcpInvoc;
	/**
	 * 连接特定的 DNS 后缀
	 */
	private String specialDnsSuffix;
	/**
	 * 自动配置已启用
	 */
	private String autoConfigInvoc;
	/**
	 * 子网掩码
	 */
	private String subnetMask;
	/**
	 * 默认网关
	 */
	private List<String> defaultGateway;
	/**
	 * DHCPv6 IAID
	 */
	private String dhcpV6IAID;
	/**
	 * DHCPv6 客户端 DUID
	 */
	private String dhcpV6ClientDUID;
	/**
	 * DNS 服务器
	 */
	private List<String> dnsServer;
	/**
	 * DHCP 服务器
	 */
	private List<String> dhcpServer;
	/**
	 * TCPIP 上的 NetBIOS
	 */
	private String tcpipNetBIOS;
	/**
	 * 媒体状态
	 */
	private String mediaStatus;
	
	/**
	 * 主WINS服务器
	 */
	private String primaryWINSServer;
	public String getPrimaryWINSServer() {
		return primaryWINSServer;
	}
	public void setPrimaryWINSServer(String primaryWINSServer) {
		this.primaryWINSServer = primaryWINSServer;
	}
	public String getIpv4Addr() {
		return ipv4Addr;
	}
	public void setIpv4Addr(String ipv4Addr) {
		this.ipv4Addr = ipv4Addr;
	}
	public String getIpv6Addr() {
		return ipv6Addr;
	}
	public void setIpv6Addr(String ipv6Addr) {
		this.ipv6Addr = ipv6Addr;
	}
	public String getIpv6AddrTmp() {
		return ipv6AddrTmp;
	}
	public void setIpv6AddrTmp(String ipv6AddrTmp) {
		this.ipv6AddrTmp = ipv6AddrTmp;
	}
	public String getIpv6AddrLocal() {
		return ipv6AddrLocal;
	}
	public void setIpv6AddrLocal(String ipv6AddrLocal) {
		this.ipv6AddrLocal = ipv6AddrLocal;
	}
	public String getLeaseGetTime() {
		return leaseGetTime;
	}
	public void setLeaseGetTime(String leaseGetTime) {
		this.leaseGetTime = leaseGetTime;
	}
	public String getLeaseTimeout() {
		return leaseTimeout;
	}
	public void setLeaseTimeout(String leaseTimeout) {
		this.leaseTimeout = leaseTimeout;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getMac() {
		return mac;
	}
	public void setMac(String mac) {
		this.mac = mac;
	}
	public String getDhcpInvoc() {
		return dhcpInvoc;
	}
	public void setDhcpInvoc(String dhcpInvoc) {
		this.dhcpInvoc = dhcpInvoc;
	}
	public String getSpecialDnsSuffix() {
		return specialDnsSuffix;
	}
	public void setSpecialDnsSuffix(String specialDnsSuffix) {
		this.specialDnsSuffix = specialDnsSuffix;
	}
	public String getAutoConfigInvoc() {
		return autoConfigInvoc;
	}
	public void setAutoConfigInvoc(String autoConfigInvoc) {
		this.autoConfigInvoc = autoConfigInvoc;
	}
	public String getSubnetMask() {
		return subnetMask;
	}
	public void setSubnetMask(String subnetMask) {
		this.subnetMask = subnetMask;
	}
	public List<String> getDefaultGateway() {
		return defaultGateway;
	}
	public void setDefaultGateway(List<String> defaultGateway) {
		this.defaultGateway = defaultGateway;
	}
	public String getDhcpV6IAID() {
		return dhcpV6IAID;
	}
	public void setDhcpV6IAID(String dhcpV6IAID) {
		this.dhcpV6IAID = dhcpV6IAID;
	}
	public String getDhcpV6ClientDUID() {
		return dhcpV6ClientDUID;
	}
	public void setDhcpV6ClientDUID(String dhcpV6ClientDUID) {
		this.dhcpV6ClientDUID = dhcpV6ClientDUID;
	}
	public List<String> getDnsServer() {
		return dnsServer;
	}
	public void setDnsServer(List<String> dnsServer) {
		this.dnsServer = dnsServer;
	}
	public List<String> getDhcpServer() {
		return dhcpServer;
	}
	public void setDhcpServer(List<String> dhcpServer) {
		this.dhcpServer = dhcpServer;
	}
	public String getTcpipNetBIOS() {
		return tcpipNetBIOS;
	}
	public void setTcpipNetBIOS(String tcpipNetBIOS) {
		this.tcpipNetBIOS = tcpipNetBIOS;
	}
	public String getMediaStatus() {
		return mediaStatus;
	}
	public void setMediaStatus(String mediaStatus) {
		this.mediaStatus = mediaStatus;
	}
	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		if(this.mediaStatus != null) {
			sb.append("媒体状态:\t\t").append(this.mediaStatus).append(NEW_LINE);
		}
		if(this.specialDnsSuffix != null) {
			sb.append("连接特定的 DNS 后缀:\t\t").append(this.specialDnsSuffix).append(NEW_LINE);
		}
		if(this.description != null) {
			sb.append("描述:\t\t\t").append(this.description).append(NEW_LINE);
		}
		if(this.mac != null) {
			sb.append("物理地址:\t\t").append(this.mac).append(NEW_LINE);
		}
		if(this.dhcpInvoc != null) {
			sb.append("DHCP 已启用:\t\t").append(this.dhcpInvoc).append(NEW_LINE);
		}
		if(this.autoConfigInvoc != null) {
			sb.append("自动配置已启用:\t\t").append(this.autoConfigInvoc).append(NEW_LINE);
		}
		if(this.ipv6Addr != null) {
			sb.append("IPv6 地址:\t\t").append(this.ipv6Addr).append(NEW_LINE);
		}
		if(this.ipv6AddrTmp != null) {
			sb.append("临时 IPv6 地址:\t\t").append(this.ipv6AddrTmp).append(NEW_LINE);
		}
		if(this.ipv6AddrLocal != null) {
			sb.append("本地链接 IPv6 地址:\t").append(this.ipv6AddrLocal).append(NEW_LINE);
		}
		if(this.ipv4Addr != null) {
			sb.append("IPv4 地址:\t\t").append(this.ipv4Addr).append(NEW_LINE);
		}
		if(this.subnetMask != null) {
			sb.append("子网掩码:\t\t").append(this.subnetMask).append(NEW_LINE);
		}
		if(this.leaseGetTime != null) {
			sb.append("获得租约的时间:\t\t").append(this.leaseGetTime).append(NEW_LINE);
		}
		if(this.leaseTimeout != null) {
			sb.append("租约过期的时间:\t\t").append(this.leaseTimeout).append(NEW_LINE);
		}
		if(this.defaultGateway != null) {
			sb.append("默认网关:\t\t");
			for(int i = 0, size = this.defaultGateway.size(); i < size; i++) {
				if(i > 0) {
					sb.append("\t\t\t").append(this.defaultGateway.get(i)).append(NEW_LINE);
				} else {
					sb.append(this.defaultGateway.get(i)).append(NEW_LINE);
				}
			}
		}
		if(this.dhcpV6IAID != null) {
			sb.append("DHCPv6 IAID:\t\t").append(this.dhcpV6IAID).append(NEW_LINE);
		}
		if(this.dhcpV6ClientDUID != null) {
			sb.append("DHCPv6 客户端 DUID:\t").append(this.dhcpV6ClientDUID).append(NEW_LINE);
		}
		if(this.dhcpServer != null) {
			sb.append("DHCP 服务器:\t\t");
			for(int i = 0, size = this.dhcpServer.size(); i < size; i++) {
				if(i > 0) {
					sb.append("\t\t\t").append(this.dhcpServer.get(i)).append(NEW_LINE);
				} else {
					sb.append(this.dhcpServer.get(i)).append(NEW_LINE);
				}
			}
		}
		if(this.dnsServer != null) {
			sb.append("DNS 服务器:\t\t");
			for(int i = 0, size = this.dnsServer.size(); i < size; i++) {
				if(i > 0) {
					sb.append("\t\t\t").append(this.dnsServer.get(i)).append(NEW_LINE);
				} else {
					sb.append(this.dnsServer.get(i)).append(NEW_LINE);
				}
			}
		}
		if(this.primaryWINSServer != null) {
			sb.append("主 WINS 服务器:\t\t").append(this.primaryWINSServer).append(NEW_LINE);
		}
		if(this.tcpipNetBIOS != null) {
			sb.append("TCPIP 上的 NetBIOS:\t").append(this.tcpipNetBIOS).append(NEW_LINE);
		}
		return sb.toString();
	}
}

3、测试与解析类

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class TestNetworkAnalysis {

	private static String IPCONFIG_ALL = "cmd /c ipconfig /all";
	private NetworkBasic netBasic = null;
	private static String CLN = ":";
	
	public static void main(String[] args) {
		TestNetworkAnalysis t = new TestNetworkAnalysis();
		t.init();
		System.out.println("解析后的Java对象:\r\n" + t.netBasic);
	}
	
	public void init() {
		boolean mainConfig = false;
		String value = null, label = null; 
		NetworkBean bean = null;
		List<String> list = this.execReturnRet(IPCONFIG_ALL);
		//List<String> list = Arrays.asList(ss);
		for(String el : list) {
			el = el.trim();
			if("".equals(el)) {
				continue;
			}
			if("Windows IP 配置".equals(el) || "Windows IP Configuration".equals(el)) {
				mainConfig = true;
				netBasic = new NetworkBasic();
				continue;
			}
			if((el.startsWith("以太网适配器") || el.startsWith("Ethernet adapter") 
					|| el.startsWith("无线局域网适配器") || el.startsWith("WLAN adapter")
					|| el.startsWith("隧道适配器") || el.startsWith("Tunnel adapter")) && el.endsWith(CLN)) {
				mainConfig = false;
				bean = new NetworkBean();
				netBasic.addNetworkBeah(el.replace(CLN, ""), bean);
				continue;
			}
			if(el.indexOf(CLN) > 0 && el.indexOf(".") > 0) {
				label = el.substring(0, el.indexOf(CLN));
				value = el.substring(el.indexOf(CLN) + 1).trim();
			} else {
				value = el;
				el = label + CLN + el;
			}
			if(mainConfig) {
				if(el.startsWith("主机名") || el.startsWith("Host Name")) {
					netBasic.setHostName(value);
				} else if(el.startsWith("主 DNS 后缀") || el.startsWith("Primary Dns Suffix")) {
					netBasic.setMainDnsSuf(value);
				} else if(el.startsWith("节点类型") || el.startsWith("Node Type")) {
					netBasic.setNodeType(value);
				} else if(el.startsWith("IP 路由已启用") || el.startsWith("IP Routing Enabled")) {
					netBasic.setIpRouteInvocation(value);
				} else if(el.startsWith("WINS 代理已启用")  || el.startsWith("WINS Proxy Enabled")) {
					netBasic.setWinsAgentInvocation(value);
				} else if(el.startsWith("DNS 后缀搜索列表") || el.startsWith("DNS Suffix Search List")) {
					netBasic.setDnsSufSerchList(value);
				}
				continue;
			}
			
			if(!mainConfig) {
				if(el.startsWith("连接特定的 DNS 后缀") || el.startsWith("Connection-specific DNS Suffix")) {
					bean.setSpecialDnsSuffix(value);
				} else if(el.startsWith("描述") || el.startsWith("Description")) {
					bean.setDescription(value);
				} else if(el.startsWith("物理地址") || el.startsWith("Physical Address")) {
					bean.setMac(value);
				} else if(el.startsWith("DHCP 已启用") || el.startsWith("Dhcp Enabled")) {
					bean.setDhcpInvoc(value);
				} else if(el.startsWith("自动配置已启用") || el.startsWith("Autoconfiguration Enabled")) {
					bean.setAutoConfigInvoc(value);
				} else if(el.startsWith("IPv6 地址")) {
					bean.setIpv6Addr(value);
				} else if(el.startsWith("临时 IPv6 地址")) {
					bean.setIpv6AddrTmp(value);
				} else if(el.startsWith("本地链接 IPv6 地址")) {
					bean.setIpv6AddrLocal(value);
				} else if(el.startsWith("IPv4 地址") || el.startsWith("IP Address")) {
					bean.setIpv4Addr(value);
				} else if(el.startsWith("子网掩码") || el.startsWith("Subnet Mask")) {
					bean.setSubnetMask(value);
				} else if(el.startsWith("获得租约的时间") || el.startsWith("Lease Obtained")) {
					bean.setLeaseGetTime(value);
				} else if(el.startsWith("租约过期的时间") || el.startsWith("Lease Expires")) {
					bean.setLeaseTimeout(value);
				} else if(el.startsWith("默认网关") || el.startsWith("Default Gateway")) {
					List<String> defaultGateway = bean.getDefaultGateway();
					if(defaultGateway == null) {
						defaultGateway = new ArrayList<String>();
						bean.setDefaultGateway(defaultGateway);
					}
					defaultGateway.add(value);
				} else if(el.startsWith("DHCP 服务器") || el.startsWith("DHCP Server")) {
					List<String> dhcpServer = bean.getDhcpServer();
					if(dhcpServer == null) {
						dhcpServer = new ArrayList<String>();
						bean.setDhcpServer(dhcpServer);
					}
					dhcpServer.add(value);
				} else if(el.startsWith("DNS 服务器") || el.startsWith("DNS Servers")) {
					List<String> dnsServer = bean.getDnsServer();
					if(dnsServer == null) {
						dnsServer = new ArrayList<String>();
						bean.setDnsServer(dnsServer);
					}
					dnsServer.add(value);
				} else if(el.startsWith("TCPIP 上的 NetBIOS")) {
					bean.setTcpipNetBIOS(value);
				} else if(el.startsWith("媒体状态") || el.startsWith("Media State")) {
					bean.setMediaStatus(value);
				} else if(el.startsWith("DHCPv6 IAID")) {
					bean.setDhcpV6IAID(value);
				} else if(el.startsWith("DHCPv6 客户端 DUID")) {
					bean.setDhcpV6ClientDUID(value);
				} else if(el.startsWith("主 WINS 服务器") || el.startsWith("Primary WINS Server")) {
					bean.setPrimaryWINSServer(value);
				}
				continue;
			}
			
		}	
	}
	
	/**
	 * 执行dos命令,需要使用返回结果
	 * @return 获取返回结果
	 */
	public List<String> execReturnRet(String cmd) {
		System.out.println("执行的DOS命令:" + cmd);
		try {
			Process process = Runtime.getRuntime().exec(cmd);
			BufferedReader normal = new BufferedReader(new InputStreamReader(process.getInputStream(), "GBK"));
			BufferedReader error = new BufferedReader(new InputStreamReader(process.getErrorStream(), "GBK"));
			List<String> normalList = getOutputReturnList(normal);
			List<String> errorList = getOutputReturnList(error);
			System.out.println("正常结果:" + normalList);
			System.out.println("错误结果:" + errorList);
			int exitVal = process.waitFor();
			if (exitVal != 0) {
				System.out.println("执行的DOS命令,错误信息如下:");
			}
			if(normalList.size() > 0) {
				return normalList;
			} else {
				return null;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
	/**
	 * 获取流信息并转为List返回
	 * @param input
	 * @return
	 * @throws IOException
	 */
	private List<String> getOutputReturnList(BufferedReader input) throws IOException {
		List<String> list = new LinkedList<String>();
		String line = null;
		while ((line = input.readLine()) != null) {
			if (!"null".equals(line)) {
				list.add(line + "\r\n");
			}
		}
		return list;
	}
}
		

4、执行结果

执行的DOS命令:cmd /c ipconfig /all
正常结果:[
, Windows IP 配置
, 
,    主机名  . . . . . . . . . . . . . : 8OF1OS225YT7MFZ
,    主 DNS 后缀 . . . . . . . . . . . : 
,    节点类型  . . . . . . . . . . . . : 混合
,    IP 路由已启用 . . . . . . . . . . :,    WINS 代理已启用 . . . . . . . . . :, 
, 无线局域网适配器 无线网络连接:
, 
,    连接特定的 DNS 后缀 . . . . . . . : 
,    描述. . . . . . . . . . . . . . . : Broadcom BCM943228Z 802.11abgn 2x2 M.2 Wi-Fi Adapter
,    物理地址. . . . . . . . . . . . . : C8-FF-28-A7-D8-55
,    DHCP 已启用 . . . . . . . . . . . :,    自动配置已启用. . . . . . . . . . :,    IPv6 地址 . . . . . . . . . . . . : 2409:890c:9c10:257b:dc85:e60:e1a7:a3a1(首选) 
,    临时 IPv6 地址. . . . . . . . . . : 2409:890c:9c10:257b:3160:3829:8534:b815(首选) 
,    本地链接 IPv6 地址. . . . . . . . : fe80::dc85:e60:e1a7:a3a1%13(首选) 
,    IPv4 地址 . . . . . . . . . . . . : 192.168.43.124(首选) 
,    子网掩码  . . . . . . . . . . . . : 255.255.255.0
,    获得租约的时间  . . . . . . . . . : 202111214:57:04
,    租约过期的时间  . . . . . . . . . : 202111218:14:25
,    默认网关. . . . . . . . . . . . . : fe80::8af8:72ff:fe0a:55ee%13
,                                        192.168.43.1
,    DHCP 服务器 . . . . . . . . . . . : 192.168.43.1
,    DNS 服务器  . . . . . . . . . . . : 192.168.43.1
,    TCPIP 上的 NetBIOS  . . . . . . . : 已启用
, 
, 以太网适配器 本地连接:
, 
,    媒体状态  . . . . . . . . . . . . : 媒体已断开
,    连接特定的 DNS 后缀 . . . . . . . : 
,    描述. . . . . . . . . . . . . . . : Realtek PCIe GBE Family Controller
,    物理地址. . . . . . . . . . . . . : 70-5A-0F-1E-E8-BC
,    DHCP 已启用 . . . . . . . . . . . :,    自动配置已启用. . . . . . . . . . :, 
, 以太网适配器 VMware Network Adapter VMnet1:
, 
,    连接特定的 DNS 后缀 . . . . . . . : 
,    描述. . . . . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet1
,    物理地址. . . . . . . . . . . . . : 00-50-56-C0-00-01
,    DHCP 已启用 . . . . . . . . . . . :,    自动配置已启用. . . . . . . . . . :,    本地链接 IPv6 地址. . . . . . . . : fe80::f4d2:cb5:f51b:6d72%25(首选) 
,    IPv4 地址 . . . . . . . . . . . . : 192.168.146.1(首选) 
,    子网掩码  . . . . . . . . . . . . : 255.255.255.0
,    默认网关. . . . . . . . . . . . . : 
,    DHCPv6 IAID . . . . . . . . . . . : 486559830
,    DHCPv6 客户端 DUID  . . . . . . . : 00-01-00-01-1F-2B-F1-59-70-5A-0F-1E-E8-BC
,    DNS 服务器  . . . . . . . . . . . : fec0:0:0:ffff::1%1
,                                        fec0:0:0:ffff::2%1
,                                        fec0:0:0:ffff::3%1
,    TCPIP 上的 NetBIOS  . . . . . . . : 已启用
, 
, 以太网适配器 VMware Network Adapter VMnet8:
, 
,    连接特定的 DNS 后缀 . . . . . . . : 
,    描述. . . . . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet8
,    物理地址. . . . . . . . . . . . . : 00-50-56-C0-00-08
,    DHCP 已启用 . . . . . . . . . . . :,    自动配置已启用. . . . . . . . . . :,    本地链接 IPv6 地址. . . . . . . . : fe80::b486:3a32:37f9:ca33%26(首选) 
,    IPv4 地址 . . . . . . . . . . . . : 192.168.194.3(首选) 
,    子网掩码  . . . . . . . . . . . . : 255.255.255.0
,    默认网关. . . . . . . . . . . . . : 
,    DHCPv6 IAID . . . . . . . . . . . : 503337046
,    DHCPv6 客户端 DUID  . . . . . . . : 00-01-00-01-1F-2B-F1-59-70-5A-0F-1E-E8-BC
,    DNS 服务器  . . . . . . . . . . . : 114.114.114.114
,    TCPIP 上的 NetBIOS  . . . . . . . : 已启用
]
错误结果:[]
解析后的Java对象:

------Windows IP 配置------
主机名:		8OF1OS225YT7MFZ
主 DNS 后缀:		
节点类型:		混合
IP 路由已启用:		否
WINS 代理已启用:------无线局域网适配器 无线网络连接------
连接特定的 DNS 后缀:		
描述:			Broadcom BCM943228Z 802.11abgn 2x2 M.2 Wi-Fi Adapter
物理地址:		C8-FF-28-A7-D8-55
DHCP 已启用:		是
自动配置已启用:		是
IPv6 地址:		2409:890c:9c10:257b:dc85:e60:e1a7:a3a1(首选)
临时 IPv6 地址:		2409:890c:9c10:257b:3160:3829:8534:b815(首选)
本地链接 IPv6 地址:	fe80::dc85:e60:e1a7:a3a1%13(首选)
IPv4 地址:		192.168.43.124(首选)
子网掩码:		255.255.255.0
获得租约的时间:		202111214:57:04
租约过期的时间:		202111218:14:25
默认网关:		fe80::8af8:72ff:fe0a:55ee%13
			192.168.43.1
DHCP 服务器:		192.168.43.1
DNS 服务器:		192.168.43.1
TCPIP 上的 NetBIOS:	已启用

------以太网适配器 本地连接------
媒体状态:		媒体已断开
连接特定的 DNS 后缀:		
描述:			Realtek PCIe GBE Family Controller
物理地址:		70-5A-0F-1E-E8-BC
DHCP 已启用:		是
自动配置已启用:------以太网适配器 VMware Network Adapter VMnet1------
连接特定的 DNS 后缀:		
描述:			VMware Virtual Ethernet Adapter for VMnet1
物理地址:		00-50-56-C0-00-01
DHCP 已启用:		否
自动配置已启用:		是
本地链接 IPv6 地址:	fe80::f4d2:cb5:f51b:6d72%25(首选)
IPv4 地址:		192.168.146.1(首选)
子网掩码:		255.255.255.0
默认网关:		
DHCPv6 IAID:		486559830
DHCPv6 客户端 DUID:	00-01-00-01-1F-2B-F1-59-70-5A-0F-1E-E8-BC
DNS 服务器:		fec0:0:0:ffff::1%1
			fec0:0:0:ffff::2%1
			fec0:0:0:ffff::3%1
TCPIP 上的 NetBIOS:	已启用

------以太网适配器 VMware Network Adapter VMnet8------
连接特定的 DNS 后缀:		
描述:			VMware Virtual Ethernet Adapter for VMnet8
物理地址:		00-50-56-C0-00-08
DHCP 已启用:		否
自动配置已启用:		是
本地链接 IPv6 地址:	fe80::b486:3a32:37f9:ca33%26(首选)
IPv4 地址:		192.168.194.3(首选)
子网掩码:		255.255.255.0
默认网关:		
DHCPv6 IAID:		503337046
DHCPv6 客户端 DUID:	00-01-00-01-1F-2B-F1-59-70-5A-0F-1E-E8-BC
DNS 服务器:		114.114.114.114
TCPIP 上的 NetBIOS:	已启用
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值