要求获取各种文件的版本信息
没有版本信息就返回版本为'0'
如: Exe 文件且有版本信息的话 返回版本字符串,如: 1.0.2.2
.txt 文件,返回 '0'
没有版本信息就返回版本为'0'
如: Exe 文件且有版本信息的话 返回版本字符串,如: 1.0.2.2
.txt 文件,返回 '0'
解决方案 »
- delphi7连接Access数据库问题
- 关于 DBGrid 请教下
- 帮帮忙,谁有这几个控件,谢谢各位了
- Pos区分大小写怎么办啊?
- 在处理一个区域的颜色时,想要保存区域内颜色的纹理,对比度,要怎样进行?
- 详细设计的讨论
- 在IntraWeb中使用ADO连接数据库
- 客户端如何才能找到安装了服务端软件计算机的ip地址
- 出错啦,用 'DirectoryExists'创建目录时提示Undeclared identifier: 'DirectoryExists'
- 我想写个同学录,还请各位给点意见!
- 如果用tlist来保存bmp图形,那么该如何给它赋值呢?我试过tbmp.b.Assign(image1.picture.Bitmap)不能通过。
- 如何用delphi执行一段机器码指令?
var
InfoSize, Wnd: DWORD;
VerBuf: Pointer;
szName: array[0..255] of Char;
Value: Pointer;
Len: UINT;
TransString:string;
begin
InfoSize := GetFileVersionInfoSize(PChar(FileName), Wnd);
if InfoSize <> 0 then
begin
GetMem(VerBuf, InfoSize);
try
if GetFileVersionInfo(PChar(FileName), Wnd, InfoSize, VerBuf) then
begin
Value :=nil;
VerQueryValue(VerBuf, '\VarFileInfo\Translation', Value, Len);
if Value <> nil then
TransString := IntToHex(MakeLong(HiWord(Longint(Value^)), LoWord(Longint(Value^))), 8);
Result := '';
StrPCopy(szName, '\StringFileInfo\'+Transstring+'\FileVersion');
^^^^^^^此处换成ProductVersion得到的是"产品版本"
if VerQueryValue(VerBuf, szName, Value, Len) then
Result := StrPas(PChar(Value));
end;
finally
FreeMem(VerBuf);
end;
end;
end;