#pragma once #include "CClasses.h" #include #define _CRT_SECURE_NO_DEPRECATE #include #include #pragma comment(lib, "urlmon.lib") #include #pragma comment(lib,"shlwapi.lib") #include #include #pragma comment(lib,"wininet.lib") #define MAXBLOCKSIZE 1024 #include #include #include #include "KeyVar.h" #include #include "CDownLoadFile.h" #include #include "CharConvert.h" #include "KeyVar.h" using namespace std; class DeviceProduct { public: DeviceProduct(wstring ProductName); ~DeviceProduct(); private: DeviceProduct(); private: wstring m_Version; wstring m_ProductName; wstring m_InstallLocation; wstring m_NETVersion; wstring m_NETTargetVersion; wstring m_VsCPulsPulsVersion; wstring m_VsCPulsPulsInstalled; public: //产品版本号 wstring GetVersion(); //产品安装路径 wstring GetInstallLocation(); wstring GetNETVersion(); wstring GetNETTargetVersion(); wstring GetVsCPulsPulsVersion(); wstring GetVsCPulsPulsInstalled(); private: //访问LocalMachine主键 bool OpenLocalMachineRootKey(LPCTSTR productsInfoPath); //搜索所有产品 bool SearchAllProducts(HKEY hKey, LPCTSTR productsInfoPath); //产找产品信息 bool FindProductInfo(HKEY hKey, LPCTSTR lpSubKey); //访问LocalMachine下指定的路径 bool OpenLocalMachineSubKey(wstring AppKey); bool FindNETFramework(); bool FindVsCPulsPulsRedistributable(); };