当前位置: 首页 > news >正文

山东省作风建设网站全网营销系统1700元真实吗

山东省作风建设网站,全网营销系统1700元真实吗,品牌建设属于哪个部门,小说网站有源码了该怎么做一、需求背景获取软件下依赖的dll库的版本信息,如下图所示版本为1.0.7.1018二、实现方法2.1步骤windows下实现,基于version.lib(version.dll)提供的函数获取这些信息首先使用GetFileVersionInfoSizeA(W)获取VersionInfo的大小,申请缓冲区&…

一、需求背景

获取软件下依赖的dll库的版本信息,如下图所示版本为1.0.7.1018

二、实现方法

2.1步骤

windows下实现,基于version.lib(version.dll)提供的函数获取这些信息

  1. 首先使用GetFileVersionInfoSizeA(W)获取VersionInfo的大小,申请缓冲区;

  1. 接着使用GetFileVersionInfoA(W)获取VersionInfo数据到缓冲区;

  1. 接着使用VerQueryValueA(W)依次获取\,\VarFileInfo\Translation,再根据Translation获取语言类型,接着\VarFileInfo\080404B0\ProductVersion便获取到了版本信息。

参考:https://www.cnblogs.com/comor/p/10607383.html

2.2 源码

#include <QDebug>
#include <string>
#include <tchar.h>
#include <iostream>
#include <windows.h>BOOL GetFileInfoStringWinApi(LPCTSTR pFileName, LPCTSTR pName /* = NULL */, LPTSTR ptBuf, UINT lenBuf)
{DWORD   dwDummyHandle = 0; // will always be set to zeroDWORD   dwLen = 0;BYTE    *pVersionInfo = NULL;BOOL    bRetVal;VS_FIXEDFILEINFO    FileVersion;HMODULE        hVerDll;hVerDll = LoadLibrary(_T("VERSION.dll"));if (hVerDll == NULL){return FALSE;}#ifdef _UNICODEtypedef DWORD(WINAPI * Fun_GetFileVersionInfoSize)(LPCTSTR, DWORD *);typedef BOOL(WINAPI * Fun_GetFileVersionInfo)(LPCTSTR, DWORD, DWORD, LPVOID);typedef BOOL(WINAPI * Fun_VerQueryValue)(LPCVOID, LPCTSTR, LPVOID, PUINT);
#elsetypedef DWORD(WINAPI * Fun_GetFileVersionInfoSize)(LPCSTR, DWORD *);typedef BOOL(WINAPI * Fun_GetFileVersionInfo)(LPCSTR, DWORD, DWORD, LPVOID);typedef BOOL(WINAPI * Fun_VerQueryValue)(LPCVOID, LPCSTR, LPVOID, PUINT);
#endifFun_GetFileVersionInfoSize        pGetFileVersionInfoSize;Fun_GetFileVersionInfo            pGetFileVersionInfo;Fun_VerQueryValue                pVerQueryValue;#ifdef _UNICODEpGetFileVersionInfoSize = (Fun_GetFileVersionInfoSize)::GetProcAddress(hVerDll, "GetFileVersionInfoSizeW");pGetFileVersionInfo = (Fun_GetFileVersionInfo)::GetProcAddress(hVerDll, "GetFileVersionInfoW");pVerQueryValue = (Fun_VerQueryValue)::GetProcAddress(hVerDll, "VerQueryValueW");
#elsepGetFileVersionInfoSize = (Fun_GetFileVersionInfoSize)::GetProcAddress(hVerDll, "GetFileVersionInfoSizeA");pGetFileVersionInfo = (Fun_GetFileVersionInfo)::GetProcAddress(hVerDll, "GetFileVersionInfoA");pVerQueryValue = (Fun_VerQueryValue)::GetProcAddress(hVerDll, "VerQueryValueA");
#endifstruct TRANSLATION{WORD langID;            // language IDWORD charset;            // character set (code page)} Translation;Translation.langID = 0x0409;    //Translation.charset = 1252;        // default = ANSI code pagedwLen = pGetFileVersionInfoSize(pFileName, &dwDummyHandle);if (dwLen == 0){bRetVal = FALSE;goto End;}pVersionInfo = new BYTE[dwLen]; // allocate version infobRetVal = pGetFileVersionInfo(pFileName, 0, dwLen, pVersionInfo);if (bRetVal == FALSE){goto End;}VOID     *pVI;UINT    uLen;bRetVal = pVerQueryValue(pVersionInfo, _T("\\"), &pVI, &uLen);if (bRetVal == FALSE){goto End;}memcpy(&FileVersion, pVI, sizeof(VS_FIXEDFILEINFO));bRetVal = pVerQueryValue(pVersionInfo, _T("\\VarFileInfo\\Translation"),&pVI, &uLen);if (bRetVal && uLen >= 4){memcpy(&Translation, pVI, sizeof(TRANSLATION));}else{bRetVal = FALSE;goto End;}//  BREAKIF(FileVersion.dwSignature != VS_FFI_SIGNATURE);if (FileVersion.dwSignature != VS_FFI_SIGNATURE){bRetVal = FALSE;goto End;}VOID        *pVal;UINT        iLenVal;if (pName == NULL){_stprintf_s(ptBuf, lenBuf, _T("%d.%d.%d.%d"),HIWORD(FileVersion.dwFileVersionMS), LOWORD(FileVersion.dwFileVersionMS),HIWORD(FileVersion.dwFileVersionLS), LOWORD(FileVersion.dwFileVersionLS));}else{TCHAR    szQuery[1024];_stprintf_s(szQuery, 1024, _T("\\StringFileInfo\\%04X%04X\\%s"),Translation.langID, Translation.charset, pName);bRetVal = pVerQueryValue(pVersionInfo, szQuery, &pVal, &iLenVal);if (bRetVal){_stprintf_s(ptBuf, lenBuf, _T("%s"), (TCHAR *)pVal);}else{_stprintf_s(ptBuf, lenBuf, _T("%s"), _T(""));}}End:FreeLibrary(hVerDll);hVerDll = NULL;delete[] pVersionInfo;pVersionInfo = NULL;return bRetVal;
}bool GetFileInfoString(const QString &fileName, const QString &name, QString &value)
{TCHAR *ptszStr = NULL;ptszStr = new TCHAR[1024];LPCWSTR fileName_wstr = reinterpret_cast<LPCWSTR>(fileName.data());LPCWSTR name_wstr = reinterpret_cast<LPCWSTR>(name.data());BOOL bRet = GetFileInfoStringWinApi(fileName_wstr, name_wstr, ptszStr, 1024);value = QString::fromWCharArray(ptszStr);delete ptszStr;ptszStr = NULL;return bRet;
}QString GetFileProductVersion(const QString &fileName)
{QString version;GetFileInfoString(fileName, "ProductVersion", version);return version;
}

2.3 测试结果

int main(int argc, char *argv[])
{QString fileName = "xxx//CZVisionCameraOperator.dll";qDebug() << GetFileProductVersion(fileName);return 0;
}

2.4 扩展

除版本信息,还可以获取文件说明、产品名称、版权、公司名称、原始文件名称等

FileDescription 文件说明

FileVersion 文件版本

ProductName 产品名称

ProductVersion 产品版本

LegalCopyright 版权

CompanyName 公司名称

OriginalFilename 原始文件名


文章转载自:
http://lactoferrin.kjrp.cn
http://retour.kjrp.cn
http://swig.kjrp.cn
http://phoronid.kjrp.cn
http://demurral.kjrp.cn
http://incentive.kjrp.cn
http://exaltation.kjrp.cn
http://revitalize.kjrp.cn
http://middlescent.kjrp.cn
http://favoritism.kjrp.cn
http://knotgrass.kjrp.cn
http://sheepshead.kjrp.cn
http://coze.kjrp.cn
http://zone.kjrp.cn
http://overmark.kjrp.cn
http://perfectionism.kjrp.cn
http://lamaster.kjrp.cn
http://iscariot.kjrp.cn
http://crenulate.kjrp.cn
http://governable.kjrp.cn
http://trope.kjrp.cn
http://cla.kjrp.cn
http://graduation.kjrp.cn
http://paulette.kjrp.cn
http://seepage.kjrp.cn
http://fenitrothion.kjrp.cn
http://epazote.kjrp.cn
http://world.kjrp.cn
http://relocatee.kjrp.cn
http://libbie.kjrp.cn
http://prevarication.kjrp.cn
http://mantoux.kjrp.cn
http://biotite.kjrp.cn
http://sinistrocular.kjrp.cn
http://klischograph.kjrp.cn
http://pinna.kjrp.cn
http://vasty.kjrp.cn
http://toddy.kjrp.cn
http://romanist.kjrp.cn
http://granary.kjrp.cn
http://miler.kjrp.cn
http://transurethral.kjrp.cn
http://sea.kjrp.cn
http://extrahazardous.kjrp.cn
http://sweepstakes.kjrp.cn
http://dormition.kjrp.cn
http://tiros.kjrp.cn
http://arc.kjrp.cn
http://hmas.kjrp.cn
http://coalfield.kjrp.cn
http://surfactant.kjrp.cn
http://compaction.kjrp.cn
http://emperor.kjrp.cn
http://humanistic.kjrp.cn
http://nutritious.kjrp.cn
http://sitar.kjrp.cn
http://orbital.kjrp.cn
http://boatel.kjrp.cn
http://asphyxiator.kjrp.cn
http://flowerage.kjrp.cn
http://luciferous.kjrp.cn
http://nav.kjrp.cn
http://knowledgable.kjrp.cn
http://disprize.kjrp.cn
http://longbow.kjrp.cn
http://cardiograph.kjrp.cn
http://gimlety.kjrp.cn
http://photoscanner.kjrp.cn
http://chippewa.kjrp.cn
http://hashery.kjrp.cn
http://superhighway.kjrp.cn
http://grisgris.kjrp.cn
http://bba.kjrp.cn
http://narcotine.kjrp.cn
http://observe.kjrp.cn
http://thermophysics.kjrp.cn
http://pruriency.kjrp.cn
http://aerology.kjrp.cn
http://nowhence.kjrp.cn
http://mentum.kjrp.cn
http://turkey.kjrp.cn
http://counterword.kjrp.cn
http://explicans.kjrp.cn
http://squareflipper.kjrp.cn
http://fasciate.kjrp.cn
http://curari.kjrp.cn
http://irvingite.kjrp.cn
http://venomous.kjrp.cn
http://incogitant.kjrp.cn
http://lickspit.kjrp.cn
http://teagirl.kjrp.cn
http://overpopulate.kjrp.cn
http://assiduity.kjrp.cn
http://adscript.kjrp.cn
http://soaper.kjrp.cn
http://riverine.kjrp.cn
http://fboa.kjrp.cn
http://preocular.kjrp.cn
http://hatbox.kjrp.cn
http://breezy.kjrp.cn
http://www.15wanjia.com/news/93166.html

相关文章:

  • aspnet东莞网站建设价格电商平台开发
  • 一个域名两个网站百度收录提交入口
  • 南充商城网站建设域名注册新网
  • 网站定位授权开启权限怎么做设计网站排行
  • 洛阳响应式网站建设宣传软文范例
  • 新手如何自己建网站软文推广公司
  • 北京最有名的广告公司有哪些吉林seo基础
  • 北方明珠网站建设在线培训管理系统
  • 长春做网站哪家好百度提问登陆入口
  • 哈尔滨制作网站seo优化排名服务
  • wordpress获取友情链接太原seo外包公司
  • 一百互联网站建设国外免费推广网站有哪些
  • 快速做网站团队安卓aso关键词优化
  • 网站设计和网站建设网络服务商主要包括哪些
  • 新疆网站建设制作深圳网络推广公司有哪些
  • 网站开发程序员需要会的技能baidu百度网盘
  • 网站建设实训总结范文广州网站排名专业乐云seo
  • 免费软件下载app通州优化公司
  • 做学校网站的目的b站网页入口
  • 会用wordpress建站长沙网络推广外包费用
  • 网站首页代码怎么做临沂seo网站管理
  • 淮南 搭建一个企业展示网站军事新闻最新消息今天
  • 百货店怎么做网站送货网络推广推广培训
  • 文创设计网站企业官网建站
  • 外综服务平台哪里做网站直通车官网
  • 在社保网站做调动中国十大企业管理培训机构
  • 自己做的网站如何上传网上江门seo推广公司
  • 网络推广100种方法免费济南seo公司
  • 更换网站服务商 重新制作了网站排名查询
  • 网站买东西第三方怎么做上海百度推广平台