获取windows 网卡GUID和ip信息】的更多相关文章

# coding: UTF-8 import _winreg GUID=dict() num = 0 netCfgInstanceID = None hkey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, \ r'System\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}') keyInfo = _winreg.QueryInfoKey(hkey) for…
1.获取Windows下的IP java.net.InetAddress.getLocalHost().getHostAddress(); 2.获取linux下的IP /** * 获取Linux下的IP地址 * * @return IP地址 * @throws SocketException */ private static String getLinuxLocalIp() throws SocketException { String ip = ""; try { for (Enu…
如图所示有多个网卡 本地网卡配置了多个IP class Public_IPOp: @staticmethod def GetLocalIP(): rt = [False] # 根节点 reg_root = win32con.HKEY_LOCAL_MACHINE # 网卡设备键的路径 reg_path = r"SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}" # 权限和参数设置 r…
#include "stdafx.h" #include <Windows.h> #include <IPHlpApi.h> #include <iostream> #pragma comment(lib,"IPHlpApi.lib") using namespace std; BOOL GetLocalAdaptersInfo() { //IP_ADAPTER_INFO结构体 PIP_ADAPTER_INFO pIpAdapte…
Select SYSTEM_USER 当前用户名, USER_NAME() 当前所有者,db_Name() 当前数据库,@@SPID 当前进程号,(select top 1 FileName from master..sysdatabases where name=db_name()) 数据库文件,HOST_ID () 客户端__ID,APP_NAME() 客户端程序,HOST_NAME() 客户端电脑,(select top 1 net_address from master..sysproc…
procedure TForm1.Button1Click(Sender: TObject); var mm:TRegistry; cpu:string; begin mm:=TRegistry.Create; with mm do begin RootKey:=HKEY_LOCAL_MACHINE; if OpenKeyReadOnly('\Hardware\Description\System\CentralProcessor\0') then begin cpu := ReadString…
#include <stdio.h> #include <string.h> #include <sys/socket.h> #include <sys/types.h> #include <sys/ioctl.h> #include <net/if.h> // #include <netinet/in.h> #include <arpa/inet.h> // #include <ifaddrs.h>…
程序猿都非常懒,你懂的! 近期在开发中,须要用到server的ip和mac信息.可是server是架设在linux系统上的,对于多网口,在获取ip时就产生了非常大的问题.以下是在windows系统上,java获取本地ip的方法.贴代码: package com.herman.test; import java.net.InetAddress; /** * @see 获取计算机ip * @author Herman.Xiong * @date 2014年5月16日 09:35:38 */ publ…
一台机器上可能不只有一个网卡,但每一个网卡只有一个MAC地址,而每一个网卡可能配置有多个IP地址:如平常的笔记本电脑中,就会有无线网卡和有线网卡(网线接口)两种:因此,如果要获得本机所有网卡的IP和MAC地址信息,则必须顺序获得每个网卡,再依次获取其信息等:在windows sdk中,用IP_ADAPTER_INFO结构体存储网卡信息,包括网卡名.网卡描述.网卡MAC地址.网卡IP等,该结构体的主要描述如下所示: typedef struct _IP_ADAPTER_INFO { struct…
由于公司现阶段大多数应用软件都是基于Windows系统开发和部署,很多软件安装部署都是在windows server 2012.windows server 2008之类的服务器上,部门同事每次测试一轮迭代或者系统测试后,在写测试报告时都需要在报告中写上测试的服务器硬件配置,如CPU.操作系统版本.内存.磁盘等,需要去远程服务器然后在服务器上各种查看服务器配置,比较浪费时间.最近学习了Python相关的知识,发现使用PYWIN32+WMI模块可以获取windows系统基本信息,并安装pyinst…