怎么在delphi程序里加上版本号?

szdino 2000-07-20 10:30:00
怎么在delphi程序里自动显示编译版本号?
请指教!
...全文
478 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
johnpei 2000-10-12
  • 打赏
  • 举报
回复
Tell you no matter!
At First,you must define a struct named 'TFixedFileInfo' and a function named 'FileInfo'.
Like me to do a example!

type
PFixedFileInfo = ^TFixedFileInfo;
TFixedFileInfo = record
dwSignature : DWORD;
dwStrucVersion : DWORD;
wFileVersionMS : WORD;
wFileVersionLS : WORD;
wProductVersionMS : WORD;
wProductVersionLS : WORD;
end;

function FileInfo( const FileName :String ) : TFixedFileInfo;
var
dwHandle, dwVersionSize : DWORD;
strSubBlock : String;
pTemp : Pointer;
pData : Pointer;
begin
strSubBlock := '\';
dwVersionSize := GetFileVersionInfoSize( PChar( FileName ),
dwHandle );
if dwVersionSize <> 0 then
begin
GetMem( pTemp, dwVersionSize );
try
if GetFileVersionInfo( PChar( FileName ),
dwHandle,
dwVersionSize,
pTemp ) then
if VerQueryValue( pTemp,
PChar( strSubBlock ),
pData,
dwVersionSize ) then
Result := PFixedFileInfo( pData )^;
finally
FreeMem( pTemp );
end;
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
f1 : string;
x : TFixedFileInfo;
begin
f1 := Application.ExeName;
x := FileInfo( f1 );
Label1.Caption := f1 +
#13#10'Version: ' + IntToStr( x.wFileVersionLS ) + '.' +
IntToStr(x.wFileVersionMS ) +#13#10'Release: ' +
IntToStr( x.wProductVersionLS) +
#13#10'Build: ' + IntToStr( x.wProductVersionMS ) ;
end;

If You need more information about File,touch me!
szdino 2000-10-12
  • 打赏
  • 举报
回复
THANK U!
szdino 2000-10-11
  • 打赏
  • 举报
回复
没有人能回答我的问题么?
猛禽 2000-10-11
  • 打赏
  • 举报
回复
我写过一个控件,在http://go1.163.com/~comanche/share/dev/mctrls.zip中,其中一个叫TAboutDialog的可实现你要的功能。
szdino 2000-07-24
  • 打赏
  • 举报
回复
先谢谢了,我去试验下
yxjdyn 2000-07-23
  • 打赏
  • 举报
回复
不知以下帮助有用否?我上网不太容易,基本上只能在周六、周日有限的时间,请见谅。例子容我想一天,好吗?
GetFile FTP Method(ActiveX)
Description

Gets the specified file from the remote host and places it in the current directory.

Return Value

Void.

Syntax

object.GetFile [RemoteFile], [LocalFile]

Parameters

RemoteFile

Optional. String containing the remote file to retrieve.
Data Type: String
Param: IN
Default Value: Empty

LocalFile

Optional. String containing the local filename to use when saving the remote file.
Data Type: String
Param: IN
Default Value: Empty

Comments

The arguments override the values from the corresponding FTP.RemoteFile and DocOutput.FileName properties. The value of the properties will not change. If the arguments are omitted, the value from the corresponding property will be used to provide a filenames for the get file operation.
Both local and remote names should be specified, even if they are the same.
Use the ReplyString to determine the result of this call. The data from this method is sent to the DocStream interface via the DocOutput event. During processing of the DocOutput event, the Operation property is set to FTPFile.
szdino 2000-07-23
  • 打赏
  • 举报
回复
GetVersionOfFile.....
我写的是个ActiveX form,用网页调用.....能给个例子么?如何在ActiveX Form里用
GetVersionOfFile????
szdino 2000-07-23
  • 打赏
  • 举报
回复
能给我个调用例子么?我不知道如何去调用这个函数在网页上的activex上,因为函数里面的path不知道如何设定
yxjdyn 2000-07-23
  • 打赏
  • 举报
回复
难道ActiveX Form不能用Win32api吗?且ActiveX Project Wizard中有include Version Information 选项。至于Events,用网页调用也一样加。
yxjdyn 2000-07-22
  • 打赏
  • 举报
回复
zyjzyj说的不是没有道理,但你还得在Form的MouseMove事件中使用 GetVersionOfFile(Api)函数即可解决。
szdino 2000-07-20
  • 打赏
  • 举报
回复
不是,我要在delphi程序的form上显示版本号,我想有没个变量,自动。。。
zyjzyj 2000-07-20
  • 打赏
  • 举报
回复
选Project菜单有Options一项 页上有VersionInfo一项,你可以加入你Exe文件的版本号

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧