//Download by http://www.NewXing.com
#include "StdAfx.h"
#include "RegUtil.h"
#include "Iphlpapi.h" #pragma comment(lib, "Iphlpapi.lib") CRegUtil::CRegUtil(void)
{
} CRegUtil::~CRegUtil(void)
{
} #define FILE_DEVICE_SCSI 0x0000001b
#define IOCTL_SCSI_MINIPORT_IDENTIFY ( ( FILE_DEVICE_SCSI << 16 ) + 0x0501 ) #define IOCTL_SCSI_MINIPORT 0x0004D008 // see NTDDSCSI.H for definition #define IDENTIFY_BUFFER_SIZE 512
#define SENDIDLENGTH ( sizeof( SENDCMDOUTPARAMS ) + IDENTIFY_BUFFER_SIZE ) #define IDE_ATAPI_IDENTIFY 0xA1 // Returns ID sector for ATAPI.
#define IDE_ATA_IDENTIFY 0xEC // Returns ID sector for ATA.
#define DFP_RECEIVE_DRIVE_DATA 0x0007c088 typedef struct _IDSECTOR
{
USHORT wGenConfig;
USHORT wNumCyls;
USHORT wReserved;
USHORT wNumHeads;
USHORT wBytesPerTrack;
USHORT wBytesPerSector;
USHORT wSectorsPerTrack;
USHORT wVendorUnique[];
CHAR sSerialNumber[];
USHORT wBufferType;
USHORT wBufferSize;
USHORT wECCSize;
CHAR sFirmwareRev[];
CHAR sModelNumber[];
USHORT wMoreVendorUnique;
USHORT wDoubleWordIO;
USHORT wCapabilities;
USHORT wReserved1;
USHORT wPIOTiming;
USHORT wDMATiming;
USHORT wBS;
USHORT wNumCurrentCyls;
USHORT wNumCurrentHeads;
USHORT wNumCurrentSectorsPerTrack;
ULONG ulCurrentSectorCapacity;
USHORT wMultSectorStuff;
ULONG ulTotalAddressableSectors;
USHORT wSingleWordDMA;
USHORT wMultiWordDMA;
BYTE bReserved[];
} IDSECTOR, *PIDSECTOR; typedef struct _DRIVERSTATUS {
BYTE bDriverError; // Error code from driver, or 0 if no error.
BYTE bIDEStatus; // Contents of IDE Error reGISter.
// Only valid when bDriverError is SMART_IDE_ERROR.
BYTE bReserved[]; // Reserved for future expansion.
DWORD dwReserved[]; // Reserved for future expansion.
} DRIVERSTATUS, *PDRIVERSTATUS, *LPDRIVERSTATUS; typedef struct _SENDCMDOUTPARAMS
{
DWORD cBufferSize; // Size of bBuffer in bytes
DRIVERSTATUS DriverStatus; // Driver status structure.
BYTE bBuffer[]; // Buffer of arbitrary length in which to store the data read from the // drive.
} SENDCMDOUTPARAMS, *PSENDCMDOUTPARAMS, *LPSENDCMDOUTPARAMS; typedef struct _SRB_IO_CONTROL
{
ULONG HeaderLength;
UCHAR Signature[];
ULONG Timeout;
ULONG ControlCode;
ULONG ReturnCode;
ULONG Length;
} SRB_IO_CONTROL, *PSRB_IO_CONTROL; typedef struct _IDEREGS
{
BYTE bFeaturesReg; // Used for specifying SMART "commands".
BYTE bSectorCountReg; // IDE sector count register
BYTE bSectorNumberReg; // IDE sector number register
BYTE bCylLowReg; // IDE low order cylinder value
BYTE bCylHighReg; // IDE high order cylinder value
BYTE bDriveHeadReg; // IDE drive/head register
BYTE bCommandReg; // Actual IDE command.
BYTE bReserved; // reserved for future use. Must be zero.
} IDEREGS, *PIDEREGS, *LPIDEREGS; typedef struct _SENDCMDINPARAMS
{
DWORD cBufferSize; // Buffer size in bytes
IDEREGS irDriveRegs; // Structure with drive register values.
BYTE bDriveNumber; // Physical drive number to send
// command to (0,1,2,3).
BYTE bReserved[]; // Reserved for future expansion.
DWORD dwReserved[]; // For future use.
BYTE bBuffer[]; // Input buffer.
} SENDCMDINPARAMS, *PSENDCMDINPARAMS, *LPSENDCMDINPARAMS; typedef struct _GETVERSIONOUTPARAMS
{
BYTE bVersion; // Binary driver version.
BYTE bRevision; // Binary driver revision.
BYTE bReserved; // Not used.
BYTE bIDEDeviceMap; // Bit map of IDE devices.
DWORD fCapabilities; // Bit mask of driver capabilities.
DWORD dwReserved[]; // For future use.
} GETVERSIONOUTPARAMS, *PGETVERSIONOUTPARAMS, *LPGETVERSIONOUTPARAMS; ////////////////////////////////////////////////////////////////////// //结构定义
typedef struct _UNICODE_STRING
{
USHORT Length;//长度
USHORT MaximUMLength;//最大长度
PWSTR Buffer;//缓存指针
} UNICODE_STRING,*PUNICODE_STRING; typedef struct _OBJECT_ATTRIBUTES
{
ULONG Length;//长度 18h
HANDLE RootDirectory;//
PUNICODE_STRING ObjectName;//指向对象名的指针
ULONG Attributes;//对象属性00000040h
PVOID SecurityDescriptor; // Points to type SECURITY_DESCRIPTOR,0
PVOID SecurityQualityOfService; // Points to type SECURITY_QUALITY_OF_SERVICE,0
} OBJECT_ATTRIBUTES;
typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; //函数指针变量类型
typedef DWORD (__stdcall *ZWOS )( PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
typedef DWORD (__stdcall *ZWMV )( HANDLE,HANDLE,PVOID,ULONG,ULONG,PLARGE_INTEGER,PSIZE_T,DWORD,ULONG,ULONG);
typedef DWORD (__stdcall *ZWUMV )( HANDLE,PVOID); BOOL WinNTHDSerialNumAsScsiRead( BYTE* dwSerial, UINT* puSerialLen, UINT uMaxSerialLen )
{
BOOL bInfoLoaded = FALSE; for( int iController = ; iController < ; ++ iController )
{
HANDLE hScsiDriveIOCTL = ;
WCHAR szDriveName[]; // Try to get a handle to PhysicalDrive IOCTL, report failure
// and exit if can't.
swprintf(szDriveName, _T("\\\\.\\Scsi%d:"), iController); // Windows NT, Windows 2000, any rights should do
hScsiDriveIOCTL = CreateFile( szDriveName,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, , NULL); // if (hScsiDriveIOCTL == INVALID_HANDLE_VALUE)
// printf ("Unable to open SCSI controller %d, error code: 0x%lX\n",
// controller, GetLastError ()); if( hScsiDriveIOCTL != INVALID_HANDLE_VALUE )
{
int iDrive = ;
for( iDrive = ; iDrive < ; ++ iDrive )
{
char szBuffer[sizeof( SRB_IO_CONTROL ) + SENDIDLENGTH] = { }; SRB_IO_CONTROL* p = ( SRB_IO_CONTROL* )szBuffer;
SENDCMDINPARAMS* pin = ( SENDCMDINPARAMS* )( szBuffer + sizeof( SRB_IO_CONTROL ) );
DWORD dwResult; p->HeaderLength = sizeof( SRB_IO_CONTROL );
p->Timeout = ;
p->Length = SENDIDLENGTH;
p->ControlCode = IOCTL_SCSI_MINIPORT_IDENTIFY;
strncpy((char*)p->Signature, "SCSIDISK", ); pin->irDriveRegs.bCommandReg = IDE_ATA_IDENTIFY;
pin->bDriveNumber = iDrive; if( DeviceIoControl( hScsiDriveIOCTL, IOCTL_SCSI_MINIPORT,
szBuffer,
sizeof( SRB_IO_CONTROL ) + sizeof( SENDCMDINPARAMS ) - ,
szBuffer,
sizeof( SRB_IO_CONTROL ) + SENDIDLENGTH,
&dwResult, NULL ) )
{
SENDCMDOUTPARAMS* pOut = ( SENDCMDOUTPARAMS* )( szBuffer + sizeof( SRB_IO_CONTROL ) );
IDSECTOR* pId = ( IDSECTOR* )( pOut->bBuffer );
if( pId->sModelNumber[] )
{
if( * puSerialLen + 20U <= uMaxSerialLen )
{
// 序列号
CopyMemory( dwSerial + * puSerialLen, ( ( USHORT* )pId ) + , ); // Cut off the trailing blanks
UINT i;
for (i = ; i != 0U && ' ' == dwSerial[* puSerialLen + i - ]; -- i )
{}
* puSerialLen += i; // 型号
CopyMemory( dwSerial + * puSerialLen, ( ( USHORT* )pId ) + , );
// Cut off the trailing blanks
for( i = ; i != 0U && ' ' == dwSerial[* puSerialLen + i - ]; -- i )
{}
* puSerialLen += i; bInfoLoaded = TRUE;
}
else
{
::CloseHandle( hScsiDriveIOCTL );
return bInfoLoaded;
}
}
}
}
::CloseHandle( hScsiDriveIOCTL );
}
}
return bInfoLoaded;
} BOOL DoIdentify( HANDLE hPhysicalDriveIOCTL, PSENDCMDINPARAMS pSCIP,
PSENDCMDOUTPARAMS pSCOP, BYTE bIDCmd, BYTE bDriveNum,
PDWORD lpcbBytesReturned )
{
// Set up data structures for IDENTIFY command.
pSCIP->cBufferSize = IDENTIFY_BUFFER_SIZE;
pSCIP->irDriveRegs.bFeaturesReg = ;
pSCIP->irDriveRegs.bSectorCountReg = ;
pSCIP->irDriveRegs.bSectorNumberReg = ;
pSCIP->irDriveRegs.bCylLowReg = ;
pSCIP->irDriveRegs.bCylHighReg = ; // calc the drive number.
pSCIP->irDriveRegs.bDriveHeadReg = 0xA0 | ( ( bDriveNum & ) << ); // The command can either be IDE identify or ATAPI identify.
pSCIP->irDriveRegs.bCommandReg = bIDCmd;
pSCIP->bDriveNumber = bDriveNum;
pSCIP->cBufferSize = IDENTIFY_BUFFER_SIZE; return DeviceIoControl( hPhysicalDriveIOCTL, DFP_RECEIVE_DRIVE_DATA,
( LPVOID ) pSCIP,
sizeof( SENDCMDINPARAMS ) - ,
( LPVOID ) pSCOP,
sizeof( SENDCMDOUTPARAMS ) + IDENTIFY_BUFFER_SIZE - ,
lpcbBytesReturned, NULL );
} BOOL WinNTHDSerialNumASPhysicalRead( BYTE* dwSerial, UINT* puSerialLen, UINT uMaxSerialLen )
{
#define DFP_GET_VERSION 0x00074080
BOOL bInfoLoaded = FALSE; for( UINT uDrive = ; uDrive < ; ++ uDrive )
{
HANDLE hPhysicalDriveIOCTL = ; // Try to get a handle to PhysicalDrive IOCTL, report failure
// and exit if can't.
WCHAR szDriveName [];
swprintf( szDriveName, _T("\\\\.\\PhysicalDrive%d"), uDrive ); // Windows NT, Windows 2000, must have admin rights
hPhysicalDriveIOCTL = CreateFile( szDriveName,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, , NULL); if( hPhysicalDriveIOCTL != INVALID_HANDLE_VALUE )
{
GETVERSIONOUTPARAMS VersionParams = { };
DWORD cbBytesReturned = ; // Get the version, etc of PhysicalDrive IOCTL
if( DeviceIoControl( hPhysicalDriveIOCTL, DFP_GET_VERSION,
NULL,
,
&VersionParams,
sizeof( GETVERSIONOUTPARAMS ),
&cbBytesReturned, NULL ) )
{
// If there is a IDE device at number "i" issue commands
// to the device
if( VersionParams.bIDEDeviceMap != )
{
BYTE bIDCmd = ; // IDE or ATAPI IDENTIFY cmd
SENDCMDINPARAMS scip = { }; // Now, get the ID sector for all IDE devices in the system.
// If the device is ATAPI use the IDE_ATAPI_IDENTIFY command,
// otherwise use the IDE_ATA_IDENTIFY command
bIDCmd = ( VersionParams.bIDEDeviceMap >> uDrive & 0x10 ) ? IDE_ATAPI_IDENTIFY : IDE_ATA_IDENTIFY;
BYTE IdOutCmd[sizeof( SENDCMDOUTPARAMS ) + IDENTIFY_BUFFER_SIZE - ] = { }; if( DoIdentify( hPhysicalDriveIOCTL,
&scip,
( PSENDCMDOUTPARAMS )&IdOutCmd,
( BYTE )bIDCmd,
( BYTE )uDrive,
&cbBytesReturned ) )
{
if( * puSerialLen + 20U <= uMaxSerialLen )
{
CopyMemory( dwSerial + * puSerialLen, ( ( USHORT* )( ( ( PSENDCMDOUTPARAMS )IdOutCmd )->bBuffer ) ) + , ); // 序列号 // Cut off the trailing blanks
UINT i;
for (i = ; i != 0U && ' ' == dwSerial[* puSerialLen + i - ]; -- i ) {}
* puSerialLen += i; CopyMemory( dwSerial + * puSerialLen, ( ( USHORT* )( ( ( PSENDCMDOUTPARAMS )IdOutCmd )->bBuffer ) ) + , ); // 型号 // Cut off the trailing blanks
for (i = ; i != 0U && ' ' == dwSerial[* puSerialLen + i - ]; -- i ) {}
* puSerialLen += i; bInfoLoaded = TRUE;
}
else
{
::CloseHandle( hPhysicalDriveIOCTL );
return bInfoLoaded;
}
}
}
}
CloseHandle( hPhysicalDriveIOCTL );
}
}
return bInfoLoaded;
} UINT FindAwardBios( BYTE** pPBiosAddr )
{
BYTE* pBiosAddr = * pPBiosAddr + 0xEC71; BYTE szBiosData[];
CopyMemory( szBiosData, pBiosAddr, );
szBiosData[] = ; int iLen = lstrlen((LPCWSTR)szBiosData);
if( iLen > && iLen < )
{
//AWard: 07/08/2002-i845G-ITE8712-JF69VD0CC-00
//Phoenix-Award: 03/12/2002-sis645-p4s333
if( szBiosData[] == '/' && szBiosData[] == '/' )
{
BYTE* p = szBiosData;
while( * p )
{
if( * p < ' ' || * p >= )
{
break;
}
++ p;
}
if( * p == )
{
* pPBiosAddr = pBiosAddr;
return ( UINT )iLen;
}
}
}
return ;
} UINT FindAmiBios( BYTE** ppBiosAddr )
{
BYTE* pBiosAddr = * ppBiosAddr + 0xF478; BYTE szBiosData[];
CopyMemory( szBiosData, pBiosAddr, );
szBiosData[] = ; int iLen = lstrlen((LPCWSTR)szBiosData);
if( iLen > && iLen < )
{
// Example: "AMI: 51-2300-000000-00101111-030199-"
if( szBiosData[] == '-' && szBiosData[] == '-' )
{
BYTE* p = szBiosData;
while( * p )
{
if( * p < ' ' || * p >= )
{
break;
}
++ p;
}
if( * p == )
{
* ppBiosAddr = pBiosAddr;
return ( UINT )iLen;
}
}
}
return ;
} UINT FindPhoenixBios( BYTE** ppBiosAddr )
{
UINT uOffset[] = { 0x6577, 0x7196, 0x7550 };
for( UINT i = ; i < ; ++ i )
{
BYTE* pBiosAddr = * ppBiosAddr + uOffset[i]; BYTE szBiosData[];
CopyMemory( szBiosData, pBiosAddr, );
szBiosData[] = ; int iLen = lstrlen((LPCWSTR)szBiosData);
if( iLen > && iLen < )
{
// Example: Phoenix "NITELT0.86B.0044.P11.9910111055"
if( szBiosData[] == '.' && szBiosData[] == '.' )
{
BYTE* p = szBiosData;
while( * p )
{
if( * p < ' ' || * p >= )
{
break;
}
++ p;
}
if( * p == )
{
* ppBiosAddr = pBiosAddr;
return ( UINT )iLen;
}
}
}
}
return ;
} // 网卡 MAC 地址,注意: MAC 地址是可以在注册表中修改的
BOOL GetMac(LPBYTE lpInfo, UINT iSize, UINT &iCount)
{
UINT uErrorCode = ;
IP_ADAPTER_INFO iai;
ULONG uSize = ;
iCount = ;
DWORD dwResult = GetAdaptersInfo(&iai, &uSize);
if (dwResult == ERROR_BUFFER_OVERFLOW)
{
IP_ADAPTER_INFO* piai = (IP_ADAPTER_INFO*)HeapAlloc(GetProcessHeap(), , uSize);
if (piai != NULL)
{
dwResult = GetAdaptersInfo(piai, &uSize);
if (ERROR_SUCCESS == dwResult)
{
IP_ADAPTER_INFO* piai2 = piai;
while (piai2 != NULL && (iCount + piai2->AddressLength) < iSize)
{
CopyMemory(lpInfo + iCount, piai2->Address, piai2->AddressLength );
iCount += piai2->AddressLength;
piai2 = piai2->Next;
}
}
else
{
uErrorCode = 0xF0000000U + dwResult;
}
VERIFY(HeapFree(GetProcessHeap(), , piai));
}
else
{
return FALSE;
}
}
else
{
uErrorCode = 0xE0000000U + dwResult;
}
if (uErrorCode != 0U)
{
return FALSE;
}
return TRUE;
} // 硬盘序列号,注意:有的硬盘没有序列号
BOOL GetDiskSerialNum(LPBYTE lpInfo, UINT iSize, UINT &iCount)
{
iCount = ;
OSVERSIONINFO ovi = { };
ovi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&ovi); if (ovi.dwPlatformId != VER_PLATFORM_WIN32_NT)
{
// Only Windows 2000, Windows XP, Windows Server 2003...
return FALSE;
}
else
{
if (!WinNTHDSerialNumASPhysicalRead(lpInfo, &iCount, iSize))
{
return WinNTHDSerialNumAsScsiRead(lpInfo, &iCount, iSize);
}
return TRUE;
}
return FALSE;
} BOOL GetCPUId(LPBYTE lpInfo, UINT iSize, UINT &iCount)
{
BOOL bException = FALSE;
BYTE szCpu[] = { };
UINT uCpuID = 0U;
iCount = ;
__try
{
_asm
{
mov eax,
cpuid
mov dword ptr szCpu[], ebx
mov dword ptr szCpu[], edx
mov dword ptr szCpu[], ecx
mov eax,
cpuid
mov uCpuID, edx
}
}
__except( EXCEPTION_EXECUTE_HANDLER )
{
bException = TRUE;
} if (!bException)
{
CopyMemory(lpInfo + iCount, &uCpuID, sizeof(UINT));
iCount += sizeof(UINT); uCpuID = (UINT)strlen((char *)szCpu);
CopyMemory(lpInfo + iCount, szCpu, uCpuID);
iCount += uCpuID;
return TRUE;
}
return FALSE;
} BOOL GetBOISId(LPBYTE lpInfo, UINT iSize, UINT &iCount)
{
SIZE_T ssize;
iCount = ;
LARGE_INTEGER so;
so.LowPart=0x000f0000;
so.HighPart=0x00000000;
ssize=0xffff;
wchar_t strPH[] = _T("\\device\\physicalmemory"); DWORD ba=; UNICODE_STRING struniph;
struniph.Buffer = strPH;
struniph.Length = 0x2c;
struniph.MaximUMLength = 0x2e; OBJECT_ATTRIBUTES obj_ar;
obj_ar.Attributes =;
obj_ar.Length =;
obj_ar.ObjectName=&struniph;
obj_ar.RootDirectory=;
obj_ar.SecurityDescriptor=;
obj_ar.SecurityQualityOfService =; HMODULE hinstLib = LoadLibrary(_T("ntdll.dll"));
ZWOS ZWopenS = (ZWOS)GetProcAddress(hinstLib, "ZwOpenSection");
ZWMV ZWmapV = (ZWMV)GetProcAddress(hinstLib, "ZwMapViewOfSection");
ZWUMV ZWunmapV = (ZWUMV)GetProcAddress(hinstLib, "ZwUnmapViewOfSection"); //调用函数,对物理内存进行映射
HANDLE hSection;
if ( == ZWopenS(&hSection,,&obj_ar) &&
== ZWmapV(
( HANDLE )hSection, //打开Section时得到的句柄
( HANDLE )0xFFFFFFFF, //将要映射进程的句柄,
&ba, //映射的基址
,
0xFFFF, //分配的大小
&so, //物理内存的地址
&ssize, //指向读取内存块大小的指针
, //子进程的可继承性设定
, //分配类型
//保护类型
) )
//执行后会在当前进程的空间开辟一段64k的空间,并把f000:0000到f000:ffff处的内容映射到这里
//映射的基址由ba返回,如果映射不再有用,应该用ZwUnmapViewOfSection断开映射
{
BYTE* pBiosSerial = (BYTE*)ba;
UINT uBiosSerialLen = FindAwardBios(&pBiosSerial);
if (uBiosSerialLen == 0U)
{
uBiosSerialLen = FindAmiBios(&pBiosSerial);
if (uBiosSerialLen == 0U)
{
uBiosSerialLen = FindPhoenixBios(&pBiosSerial);
}
}
if (uBiosSerialLen != 0U)
{
CopyMemory(lpInfo + iCount, pBiosSerial, uBiosSerialLen);
iCount += uBiosSerialLen;
}
ZWunmapV((HANDLE)0xFFFFFFFF, ( void* )ba);
return TRUE;
}
return FALSE;
} BOOL Get()
{
BYTE szSystemInfo[]; // 在程序执行完毕后,此处存储取得的系统特征码
UINT uSystemInfoLen = ; // 在程序执行完毕后,此处存储取得的系统特征码的长度 return TRUE;
} /****************************************************************
This is a sample routine of base64 algorithm.The goal is to
illustrate principles,so some details may be ignored.
Author email:zhangwu2003@163.com
*****************************************************************/ char * ch64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; unsigned char *Base64Encode(unsigned char *src,int srclen)
{
int n,buflen,i,j;
int pading=;
unsigned char *buf;
static unsigned char *dst; buf=src;
buflen=n=srclen;
if(n%!=) /* pad with '=' by using a temp buffer */
{
pading=;
buflen=n+-n%;
buf=(unsigned char *)malloc(buflen+);
memset(buf,,buflen+);
memcpy(buf,src,n);
for(i=;i<-n%;i++)
buf[n+i]='=';
}
dst=(unsigned char *)malloc(buflen*/+);
memset(dst,,buflen*/+);
for(i=,j=;i<buflen;i+=,j+=)
{
dst[j]=(buf[i]&0xFC)>>;
dst[j+]=((buf[i]&0x03)<<) + ((buf[i+]&0xF0)>>);
dst[j+]=((buf[i+]&0x0F)<<) + ((buf[i+]&0xC0)>>);
dst[j+]=buf[i+]&0x3F;
}
for(i=;i<buflen*/;i++) /* map 6 bit value to base64 ASCII character */
dst[i]=ch64[dst[i]];
if(pading)
free(buf);
return dst;
} unsigned char *Base64Decode(unsigned char *src)
{
int n,i,j;
unsigned char *p;
static unsigned char *dst; n=(int)strlen((char *)src);
for(i=;i<n;i++) /* map base64 ASCII character to 6 bit value */
{
p=(unsigned char *)strchr(ch64,src[i]);
if(!p)
break;
src[i] = p-(unsigned char *)ch64;
}
dst=(unsigned char *)malloc(n*/+);
memset(dst,,n*/+);
for(i=,j=;i<n;i+=,j+=)
{
dst[j]=(src[i]<<) + ((src[i+]&0x30)>>);
dst[j+]=((src[i+]&0x0F)<<) + ((src[i+]&0x3C)>>);
dst[j+]=((src[i+]&0x03)<<) + src[i+];
}
return dst;
}

获取pc硬件信息杂记的更多相关文章

  1. android 获取系统硬件信息

    一,首先设置权限访问: <uses-permission android:name="android.permission.READ_PHONE_STATE" />  ...

  2. 通过wmi获取本地硬件信息的一些疑问。

    通过wmi获取本地硬件信息的一些疑问. http://bbs.csdn.net/topics/391017789 http://blog.csdn.net/xcntime/article/detail ...

  3. 获取显卡硬件信息lspci -vnn | grep VGA -A 12

    lspci -vnn | grep VGA -A 12 lshw -C display lshw -c video | grep configuration glxinfo | grep OpenGL ...

  4. C#获取电脑硬件信息(CPU ID、主板ID、硬盘ID、BIOS编号)

    最近学习过程中,想到提取系统硬件信息做一些验证,故而对网上提到的利用.NET System.Management类获取硬件信息做了进一步的学习.验证.验证是分别在4台电脑,XP SP3系统中进行,特将 ...

  5. Java获取电脑硬件信息

    package com.szht.gpy.util; import java.applet.Applet; import java.awt.Graphics; import java.io.Buffe ...

  6. 检测硬件的批处理命令,检测硬件bat,一键获取电脑硬件信息

    警告:运行BAT源码是一种危险的动作,如果你不熟悉,请不要尝试! 批处理语言: 简体中文 授权方式: 免费软件 运行环境: Windows平台 检测硬件批处理命令.一键获取.直接双击就可以查看 @ec ...

  7. c# WMI获取机器硬件信息(硬盘,cpu,内存等)

    using System; using System.Collections.Generic; using System.Globalization; using System.Management; ...

  8. C++ WMI获取系统硬件信息(CPU/DISK/NetWork etc)

    官网找到一个例子,根据例子修改下可以获取很多信息 #define _WIN32_DCOM #include <iostream> using namespace std; #include ...

  9. c# 获取机器硬件信息 (硬盘,cpu,内存等)

    using System; using System.Collections.Generic; using System.Globalization; using System.Management; ...

随机推荐

  1. 斯坦福IOS开发第五课(第二部分)

    转载请注明出处 http://blog.csdn.net/pony_maggie/article/details/27845257 作者:小马 五 代码演示样例 上面讲到的知识点在这个演示样例都有涉及 ...

  2. C# 使用Nlog记录日志到数据库

    [摘要]Nlog是一个很不错的.NET日志记录组件,它可以将日志输出到控件台,保存到文本,也可以很方便的记录到数据库中.本文为你介绍C# 使用Nlog记录日志到数据库. Nlog是一个很不错的.NET ...

  3. CCCatmullRomBy和CCPointArray

    CCCatmullRomBy:把某一对象以Catmull-Rom curve曲线移动一段距离 CCPointArray *array = CCPointArray::create(); array-& ...

  4. 递归查询SQL语句

    USE [DB] GO /****** Object: View [dbo].[v_menus] Script Date: 02/24/2014 15:55:45 ******/ SET ANSI_N ...

  5. https编程遇到PKIX:unable to find valid certification path to requested target 的问题

    https编程遇到PKIX:unable to find valid certification path to requested target 的问题 2016-12-01 解决方案见:解决PKI ...

  6. js解析url参数如http://www.taobao.com/index.php?key0=21&key1=你哈&(获取key0和key1的值)

    function parseQueryString(url) { var pos; var obj = {}; if ((pos = url.indexOf("?")) != -1 ...

  7. 【算法】转载:Iterative vs. Recursive Approaches

    Iterative vs. Recursive Approaches Eyal Lantzman, 5 Nov 2007 CPOL             Introduction This arti ...

  8. 第2章 初学 emWin 的准备工作及其快速上手

    以下内容转载自安富莱电子论坛:http://forum.armfly.com/forum.php?mod=viewthread&tid=24552&extra=page%3D3%26f ...

  9. perl 计算方差中值平均数 Statistics::Descriptive;

    http://search.cpan.org/~shlomif/Statistics-Descriptive-3.0612/lib/Statistics/Descriptive.pm use Stat ...

  10. mysql初步调试

    第一次这么近距离的接触源码,有点兴奋,又有点不知所措,尼玛随便一个源文件都有几千行,你说怎么看,还有一些数不清的数据结构,函数,类等乱七八糟的东西. 我装的mysql版本是5.7.12,然后运行平台是 ...