在create中调用就可以了

unit About;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, RzPanel, StdCtrls;

type
Tfrm_About = class(TForm)
RzPanel1: TRzPanel;
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
frm_About: Tfrm_About;

implementation

{$R *.dfm}

procedure Tfrm_About.FormCreate(Sender: TObject);
const
InfoNum = 9;
InfoStr: array[1..InfoNum] of string = (
'ProductName',
'ProductVersion',
'FileDescription',
'LegalCopyright',
'FileVersion',
'CompanyName',
'LegalTradeMarks',
'InternalName',
'OriginalFileName'
);
var
S: string;
BufSize, Len: DWORD;
Buf: PChar;
Value: PChar;
begin
S := Application.ExeName;
BufSize := GetFileVersionInfoSize(PChar(S), BufSize);
if BufSize > 0 then
begin

Buf := AllocMem(BufSize);
GetFileVersionInfo(PChar(S), 0, BufSize, Buf);
if VerQueryValue(Buf, PChar('StringFileInfo\080403A8\' + InfoStr[2]), Pointer(Value), Len) then
ShowMessage(Value);
if VerQueryValue(Buf, PChar('StringFileInfo\080403A8\' + InfoStr[1]), Pointer(Value), Len) then
ProductName.Caption := Value;
if VerQueryValue(Buf, PChar('StringFileInfo\080403A8\' + InfoStr[2]), Pointer(Value), Len) then
ProductVersion.Caption := '产品版本: ' + Value;
if VerQueryValue(Buf, PChar('StringFileInfo\080403A8\' + InfoStr[3]), Pointer(Value), Len) then
FileDescription.Caption := '文件说明: ' + Value;
if VerQueryValue(Buf, PChar('StringFileInfo\080403A8\' + InfoStr[4]), Pointer(Value), Len) then
LegalCopyright.Caption := '合法版权: ' + Value;
if VerQueryValue(Buf, PChar('StringFileInfo\080403A8\' + InfoStr[5]), Pointer(Value), Len) then
FileVersion.Caption := '文件版本: ' + Value;
if VerQueryValue(Buf, PChar('StringFileInfo\080403A8\' + InfoStr[6]), Pointer(Value), Len) then
CompanyName.Caption := '公司名称: ' + Value;
if VerQueryValue(Buf, PChar('StringFileInfo\080403A8\' + InfoStr[7]), Pointer(Value), Len) then
LegalTrademarks.Caption := '合法商标: ' + Value;
if VerQueryValue(Buf, PChar('StringFileInfo\080403A8\' + InfoStr[8]), Pointer(Value), Len) then
InternalName.Caption := '内部名称: ' + Value;
if VerQueryValue(Buf, PChar('StringFileInfo\080403A8\' + InfoStr[9]), Pointer(Value), Len) then
OriginalFilename.Caption := '原文件名: ' + Value;
FreeMem(Buf, BufSize);

// OperatingSystem.Caption := GetOSVerInfo;

// SystemMemory.Caption := GetMemStat;
end
else begin
Application.MessageBox('获取产品信息时遇到致命错误,请尝试重新启动软件。'+ #13 + '若仍未能解决问题,请联系产品服务人员。','错误',MB_OK + MB_ICONSTOP);
Application.Terminate;
end;
end;

end.

最新文章

  1. Spring Boot -- 启动彩蛋
  2. Java正则表达式, 提取双引号中间的部分
  3. CentOS 安装ftp
  4. dnf脚本的研究
  5. ibeacons社区
  6. 九度OJ 1131 合唱队形 -- 动态规划(最长递增子序列)
  7. APP安全环节缺失,手游运营商怎样应对APP破解困境
  8. target-action传值
  9. 模式识别 - libsvm该函数的调用方法 详细说明
  10. SSH没有password安全日志
  11. shell 多进程
  12. TxDragon的训练5
  13. strman--java8字符串工具类
  14. 详解IPTABLES
  15. [python] PyMouse、PyKeyboard用python操作鼠标和键盘
  16. maven项目(多模块)
  17. Android相关 博客收藏
  18. TCP/IP学习20180701-数据链路层-IP子网寻址
  19. 《机器学习实战》之k-近邻算法(示例)
  20. Python day21模块介绍4(logging模块,configparser模块)

热门文章

  1. python 常见的错误类型 和 继承关系
  2. PHP的几种遍历方法
  3. Scala 基础(8)—— 占位符_和部分应用函数
  4. 29个android开发常用的类、方法及接口
  5. Rust安装配置
  6. [中山市选2011][bzoj2440] 完全平方数 [二分+莫比乌斯容斥]
  7. vue-计算属性-computed
  8. ES6--javascript判断一个字符串是否存在另一个字符串中
  9. Topcoder SRM 603 div1题解
  10. shell面试经典70例