How to retrieve DELL Computer Service Tag by WMI programming
2007-03-04 21:19
369 查看
To accomplish my system administration task at work. I've wrote a WMI helper class to retrieve some system information (by modifying the MSDN sample code). The following code shows how to retrieve Service Tag from a Dell computer by using the simple WMI class.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Sample:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "wimhelper.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
myWMI wmiobj;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
BOOL bRet = wmiobj.Initialize();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
CString strRet = wmiobj.WMIQuery(L"SerialNumber",L"Win32_BIOS");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
/**////////////////////////////////////////////////////////////////
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Filename wmihelper.h
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma once
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "wbemidl.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include <comdef.h>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
# pragma comment(lib, "wbemuuid.lib")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class myWMI
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
IWbemLocator *m_pLoc;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
IWbemServices *m_pSvc;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CString m_strErrorMsg;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myWMI(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
~myWMI(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
BOOL Initialize(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CString WMIQuery(WCHAR* wsztrPropName ,WCHAR* wszNameSpace);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
/**////////////////////////////////////
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Filename wmihelper.cpp
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "StdAfx.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include ".winadminapi.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
myWMI::myWMI(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_pLoc = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_pSvc = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
myWMI::~myWMI(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(m_pSvc)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_pSvc->Release();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(m_pLoc)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_pLoc->Release();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CoUninitialize();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
BOOL myWMI::Initialize()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT hres;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//Step1: initialize COM
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hres = CoInitializeEx(0, COINIT_MULTITHREADED);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(hres != S_OK )
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_strErrorMsg.Format("Failed to initialize COM library. Error code: %d",hres);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return FALSE;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Step 2: --------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Set general COM security levels --------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Note: If you are using Windows 2000, you need to specify -
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// the default authentication credentials for a user by using
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// a SOLE_AUTHENTICATION_LIST structure in the pAuthList ----
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// parameter of CoInitializeSecurity ------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hres = CoInitializeSecurity(
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
-1, // COM authentication
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL, // Authentication services
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL, // Reserved
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
RPC_C_AUTHN_LEVEL_DEFAULT, // Default authentication
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL, // Authentication info
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
EOAC_NONE, // Additional capabilities
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL // Reserved
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(hres != S_OK)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_strErrorMsg.Format("Failed to initialize security. Error code: %d",hres);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return FALSE;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Step 3: ---------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Obtain the initial locator to WMI -------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hres = CoCreateInstance(
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CLSID_WbemLocator,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
0,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CLSCTX_INPROC_SERVER,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
IID_IWbemLocator, (LPVOID *) &m_pLoc);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(hres != S_OK)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_strErrorMsg.Format("Failed to create IWbemLocator object. Error code: %d",hres);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return FALSE;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Step 4: -----------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Connect to WMI through the IWbemLocator::ConnectServer method
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Connect to the rootcimv2 namespace with
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// the current user and obtain pointer m_pSvc
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// to make IWbemServices calls.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hres = m_pLoc->ConnectServer(
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_bstr_t(L"ROOT/CIMV2"), // Object path of WMI namespace
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL, // User name. NULL = current user
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL, // User password. NULL = current
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
0, // Locale. NULL indicates current
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL, // Security flags.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
0, // Authority (e.g. Kerberos)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
0, // Context object
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
&m_pSvc // pointer to IWbemServices proxy
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if (hres != S_OK)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_strErrorMsg.Format("Could not connect. Error code = %d",hres);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return FALSE; // Program has failed.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_strErrorMsg.Format("Connected to ROOT/CIMV2 WMI namespace" );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return TRUE; //Initialization successfully completed.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
CString myWMI::WMIQuery(WCHAR* wszPropName ,WCHAR* wszNameSpace)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Step 6: --------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Use the IWbemServices pointer to make requests of WMI ----
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT hres;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
IEnumWbemClassObject* pEnumerator = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bstr_t bstrQuery("SELECT * FROM ");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bstrQuery += wszNameSpace;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hres = m_pSvc->ExecQuery(
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bstr_t("WQL"),
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bstrQuery,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
&pEnumerator);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if (hres != S_OK)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_strErrorMsg.Format("Query for operating system name failed.Error code = %d",hres);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return FALSE; // Program has failed.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Step 7: -------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Get the data from the query in step 6 -------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
IWbemClassObject *pclsObj;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ULONG uReturn = 0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CString strResult;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
while (pEnumerator)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1,&pclsObj, &uReturn);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(0 == uReturn)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
break;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
VARIANT vtProp;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
VariantInit(&vtProp);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Get the value of the Name property
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hr = pclsObj->Get(wszPropName, 0, &vtProp, 0, 0); //bob.liu
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_bstr_t bstrValue = &vtProp;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strResult = (char*)bstrValue;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
VariantClear(&vtProp);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Cleanup
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// ========
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
pEnumerator->Release();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
pclsObj->Release();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//CoUninitialize();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return strResult;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Sample:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "wimhelper.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
myWMI wmiobj;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
BOOL bRet = wmiobj.Initialize();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
CString strRet = wmiobj.WMIQuery(L"SerialNumber",L"Win32_BIOS");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
/**////////////////////////////////////////////////////////////////
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Filename wmihelper.h
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#pragma once
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "wbemidl.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include <comdef.h>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
# pragma comment(lib, "wbemuuid.lib")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
class myWMI
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
IWbemLocator *m_pLoc;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
IWbemServices *m_pSvc;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CString m_strErrorMsg;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myWMI(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
~myWMI(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
BOOL Initialize(void);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CString WMIQuery(WCHAR* wsztrPropName ,WCHAR* wszNameSpace);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
/**////////////////////////////////////
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Filename wmihelper.cpp
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include "StdAfx.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
#include ".winadminapi.h"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
myWMI::myWMI(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_pLoc = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_pSvc = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
myWMI::~myWMI(void)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(m_pSvc)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_pSvc->Release();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(m_pLoc)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_pLoc->Release();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CoUninitialize();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
BOOL myWMI::Initialize()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT hres;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//Step1: initialize COM
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hres = CoInitializeEx(0, COINIT_MULTITHREADED);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(hres != S_OK )
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_strErrorMsg.Format("Failed to initialize COM library. Error code: %d",hres);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return FALSE;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Step 2: --------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Set general COM security levels --------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Note: If you are using Windows 2000, you need to specify -
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// the default authentication credentials for a user by using
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// a SOLE_AUTHENTICATION_LIST structure in the pAuthList ----
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// parameter of CoInitializeSecurity ------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hres = CoInitializeSecurity(
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
-1, // COM authentication
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL, // Authentication services
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL, // Reserved
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
RPC_C_AUTHN_LEVEL_DEFAULT, // Default authentication
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL, // Authentication info
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
EOAC_NONE, // Additional capabilities
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL // Reserved
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(hres != S_OK)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_strErrorMsg.Format("Failed to initialize security. Error code: %d",hres);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return FALSE;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Step 3: ---------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Obtain the initial locator to WMI -------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hres = CoCreateInstance(
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CLSID_WbemLocator,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
0,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CLSCTX_INPROC_SERVER,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
IID_IWbemLocator, (LPVOID *) &m_pLoc);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(hres != S_OK)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_strErrorMsg.Format("Failed to create IWbemLocator object. Error code: %d",hres);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return FALSE;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Step 4: -----------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Connect to WMI through the IWbemLocator::ConnectServer method
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Connect to the rootcimv2 namespace with
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// the current user and obtain pointer m_pSvc
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// to make IWbemServices calls.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hres = m_pLoc->ConnectServer(
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_bstr_t(L"ROOT/CIMV2"), // Object path of WMI namespace
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL, // User name. NULL = current user
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL, // User password. NULL = current
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
0, // Locale. NULL indicates current
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL, // Security flags.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
0, // Authority (e.g. Kerberos)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
0, // Context object
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
&m_pSvc // pointer to IWbemServices proxy
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if (hres != S_OK)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_strErrorMsg.Format("Could not connect. Error code = %d",hres);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return FALSE; // Program has failed.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_strErrorMsg.Format("Connected to ROOT/CIMV2 WMI namespace" );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return TRUE; //Initialization successfully completed.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
CString myWMI::WMIQuery(WCHAR* wszPropName ,WCHAR* wszNameSpace)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Step 6: --------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Use the IWbemServices pointer to make requests of WMI ----
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT hres;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
IEnumWbemClassObject* pEnumerator = NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bstr_t bstrQuery("SELECT * FROM ");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bstrQuery += wszNameSpace;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hres = m_pSvc->ExecQuery(
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bstr_t("WQL"),
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
bstrQuery,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
NULL,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
&pEnumerator);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if (hres != S_OK)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
m_strErrorMsg.Format("Query for operating system name failed.Error code = %d",hres);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return FALSE; // Program has failed.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Step 7: -------------------------------------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Get the data from the query in step 6 -------------------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
IWbemClassObject *pclsObj;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ULONG uReturn = 0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CString strResult;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
while (pEnumerator)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1,&pclsObj, &uReturn);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(0 == uReturn)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
break;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
VARIANT vtProp;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
VariantInit(&vtProp);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Get the value of the Name property
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hr = pclsObj->Get(wszPropName, 0, &vtProp, 0, 0); //bob.liu
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
_bstr_t bstrValue = &vtProp;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strResult = (char*)bstrValue;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
VariantClear(&vtProp);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Cleanup
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// ========
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
pEnumerator->Release();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
pclsObj->Release();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//CoUninitialize();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return strResult;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
相关文章推荐
- How to get report service instance name by wmi
- How to remove Oracle Database from your computer---By Roger Gong
- How to see the Physical SQL generated by a request in Presentation Service ?
- [转]How to create a Windows service by using Sc.exe
- How to remove Oracle Database from your computer---By Roger Gong
- how to trace the behavior of different components of a computer by GEM5
- How to remove Oracle Database from your computer---By Roger Gong
- How to use an ASP.NET application to query an Indexing Service catalog by using Visual Basic .NET
- How To Become a Better Programmer by Not Programming
- How to use insert or retrieve data by using Core Data in iOS
- How to remove Oracle Database from your computer---By Roger Gong
- How to remove Oracle Database from your computer---By Roger Gong
- How to remove Oracle Database from your computer---By Roger Gong
- How to move the databases that are used by SharePoint Portal Server 2003 to a computer that is running SQL Server
- How to remove Oracle Database from your computer---By Roger Gong
- How to write a Windows Service by Jarmo Muukka
- how to check logcat by specify tag
- OMAP3530 DSP Howto ( Really works by DSPLINK)
- ncurses programming howto 书中源代码-6
- How to think like a Computer Scientist: 课后习题第十八章2