比如,系统的DLL  gdi32.dll
查看其属性:点击“版本”,可以看到版权是© Microsoft Corporation. All rights reserved.
                                  公司是Microsoft Corporation。请问怎么才能拿到这些信息?

解决方案 »

  1.   

    www.vckbase.com中有一个完整的例子,标题为:从可执行文件中读取版本信息现在网站访问不了,能访问的时候你自己找吧
      

  2.   

    我贴出来吧,一个类:ExelImageVersion.h
    #if !defined(AFX_EXECIMAGEVERSION_H__75CAB01F_DD4B_11D2_84FE_00801E035520__INCLUDED_)
    #define AFX_EXECIMAGEVERSION_H__75CAB01F_DD4B_11D2_84FE_00801E035520__INCLUDED_#if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000#pragma comment (lib, "version.lib")class CExecImageVersion  
    {
    public:
    CString GetSpecialBuild();
    CString GetPrivateBuild();
    CString GetLegalTrades();
    CString GetInternalName();
    CString GetFileVersion();
    CString GetFileDescription();
    CString GetComments();
    CString GetCopyright();
    CString GetCompanyName();
    CString GetProductVersion();
    CString GetProductName();
    CExecImageVersion();
    CExecImageVersion(LPTSTR lpszImageName);
    virtual ~CExecImageVersion();private:
    void InitVer();
    LPTSTR m_lpszImageName;
    CString m_strImage;
    DWORD m_dwHandle;
    DWORD m_dwSize;
    LPVOID m_lpBuffer;
    LPVOID m_lpData;
    UINT m_uiDataSize;
    };#endif // !defined(AFX_EXECIMAGEVERSION_H__75CAB01F_DD4B_11D2_84FE_00801E035520__INCLUDED_)ExelImageVersion.cpp
    /*
     Written by Steve Bryndin ([email protected][email protected]). This code may be used in compiled form in any way you wish. This
     file may be redistributed unmodified by any means PROVIDING it is 
     not sold for profit without the authors written consent, and 
     providing that this notice and the authors name is included. 
     An email letting me know that you are using it would be 
     nice as well.  This software is provided "as is" without express or implied warranty. 
     Use it at you own risk! The author accepts no liability for any damages 
     to your computer or data these products may cause.
    */
    // ExecImageVersion.cpp: implementation of the CExecImageVersion class.
    //
    //////////////////////////////////////////////////////////////////////#include "stdafx.h"
    #include "ExecImageVersion.h"#ifdef _DEBUG
    #undef THIS_FILE
    static char THIS_FILE[]=__FILE__;
    #define new DEBUG_NEW
    #endif//////////////////////////////////////////////////////////////////////
    // Construction/Destruction
    //////////////////////////////////////////////////////////////////////CExecImageVersion::CExecImageVersion()
    {
    m_strImage = AfxGetAppName();
    m_strImage += ".exe";
    m_lpszImageName = m_strImage.GetBuffer(sizeof(m_strImage)); InitVer();
    }CExecImageVersion::CExecImageVersion(LPTSTR lpszImageName)
    {
    m_lpszImageName = lpszImageName;
    InitVer();
    }CExecImageVersion::~CExecImageVersion()
    {
    free(m_lpBuffer);
    }CString CExecImageVersion::GetProductName()
    {
    CString strProduct;

    //Use the version information block to obtain the product name.
    ::VerQueryValue(m_lpBuffer,
                TEXT("\\StringFileInfo\\040904B0\\ProductName"),
    &m_lpData,
    &m_uiDataSize);
    strProduct.Format("%s", m_lpData); return strProduct;
    }CString CExecImageVersion::GetProductVersion()
    {
    CString strProductVer;

    //Use the version information block to obtain the product name.
    ::VerQueryValue(m_lpBuffer,
                TEXT("\\StringFileInfo\\040904B0\\ProductVersion"),
    &m_lpData,
    &m_uiDataSize);
    strProductVer.Format("%s", m_lpData);
    return strProductVer;
    }CString CExecImageVersion::GetCompanyName()
    {
    CString strCompany;

    //Use the version information block to obtain the product name.
    ::VerQueryValue(m_lpBuffer,
                TEXT("\\StringFileInfo\\040904B0\\CompanyName"),
    &m_lpData,
    &m_uiDataSize);
    strCompany.Format("%s", m_lpData);
    return strCompany;
    }CString CExecImageVersion::GetCopyright()
    {
    CString strCopy; //Use the version information block to obtain the product name.
    ::VerQueryValue(m_lpBuffer,
                TEXT("\\StringFileInfo\\040904B0\\LegalCopyright"),
    &m_lpData,
    &m_uiDataSize);
    strCopy.Format("%s", m_lpData);
    return strCopy;
    }CString CExecImageVersion::GetComments()
    {
    CString strComments;

    //Use the version information block to obtain the product name.
    ::VerQueryValue(m_lpBuffer,
                TEXT("\\StringFileInfo\\040904B0\\Comments"),
    &m_lpData,
    &m_uiDataSize);
    strComments.Format("%s", m_lpData);
    return strComments;
    }CString CExecImageVersion::GetFileDescription()
    {
    CString strFileDescr;

    //Use the version information block to obtain the product name.
    ::VerQueryValue(m_lpBuffer,
                TEXT("\\StringFileInfo\\040904B0\\FileDescription"),
    &m_lpData,
    &m_uiDataSize);
    strFileDescr.Format("%s", m_lpData);
    return strFileDescr;
    }CString CExecImageVersion::GetFileVersion()
    {
    CString strFileVer; //Use the version information block to obtain the product name.
    ::VerQueryValue(m_lpBuffer,
                TEXT("\\StringFileInfo\\040904B0\\FileVersion"),
    &m_lpData,
    &m_uiDataSize);
    strFileVer.Format("%s", m_lpData);
    return strFileVer;
    }CString CExecImageVersion::GetInternalName()
    {
    CString strIN;

    //Use the version information block to obtain the product name.
    ::VerQueryValue(m_lpBuffer,
                TEXT("\\StringFileInfo\\040904B0\\InternalName"),
    &m_lpData,
    &m_uiDataSize);
    strIN.Format("%s", m_lpData);
    return strIN;
    }CString CExecImageVersion::GetLegalTrades()
    {
    CString strLegTrade;

    //Use the version information block to obtain the product name.
    ::VerQueryValue(m_lpBuffer,
                TEXT("\\StringFileInfo\\040904B0\\LegalTrades"),
    &m_lpData,
    &m_uiDataSize);
    strLegTrade.Format("%s", m_lpData);
    return strLegTrade;
    }CString CExecImageVersion::GetPrivateBuild()
    {
    CString strPrivBuild;

    //Use the version information block to obtain the product name.
    ::VerQueryValue(m_lpBuffer,
                TEXT("\\StringFileInfo\\040904B0\\PrivateBuild"),
    &m_lpData,
    &m_uiDataSize);
    strPrivBuild.Format("%s", m_lpData);
    return strPrivBuild;
    }CString CExecImageVersion::GetSpecialBuild()
    {
    CString strSpecBuild;

    //Use the version information block to obtain the product name.
    ::VerQueryValue(m_lpBuffer,
                TEXT("\\StringFileInfo\\040904B0\\SpecialBuild"),
    &m_lpData,
    &m_uiDataSize);
    strSpecBuild.Format("%s", m_lpData);
    return strSpecBuild;
    }void CExecImageVersion::InitVer()
    {
    m_dwHandle = 0;
    m_uiDataSize = 80; m_lpData = malloc(m_uiDataSize);
    // Get the version information block size,
    // then use it to allocate a storage buffer.
    m_dwSize = ::GetFileVersionInfoSize(m_lpszImageName, &m_dwHandle);
    m_lpBuffer = malloc(m_dwSize); // Get the versioninformation block
    ::GetFileVersionInfo(m_lpszImageName, 0, m_dwSize, m_lpBuffer);
    }
    使用: CExecImageVersion ver; m_strCompany = ver.GetCompanyName();
    m_strComment = ver.GetComments();
    m_strCopy = ver.GetCopyright();
    m_strFileDescr = ver.GetFileDescription();
    m_strFileVer = ver.GetFileVersion();
    m_strIntName = ver.GetInternalName();
    m_strPrivBuild = ver.GetPrivateBuild();
    m_strProductName = ver.GetProductName();
    m_strProductVer = ver.GetProductVersion();
    m_strSpecialBuild = ver.GetSpecialBuild();
    m_strTrades = ver.GetLegalTrades();
      

  3.   

    http://www.codeproject.com/dll/dllversion.asp