我可以检查安装的Indy版本吗? [英] Can I check the Indy version installed?

查看:164
本文介绍了我可以检查安装的Indy版本吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用最新的Indy组件库版本。我可以通过某些源代码命令或任何其他技巧来获取库版本,以确保使用正确的库。
我知道我正在使用 indy .... 160.bpl -这是我的Delphi XE2在将鼠标移到组件栏上时所说的。我从 Fulgan Indy

I need to use the latest Indy component library version. Can I get the library version by some source code command or any other trick to make sure I'm using the correct lib. I know I'm using the indy....160.bpl - this is what my Delphi XE2 says while moving the mouse over the component bar. The latest INDY lib I take from Fulgan Indy

推荐答案

如何在运行时使用Indy组件获取Indy版本?

How to get version of Indy by using an Indy component at runtime ?

正如@Remy在他的评论中指出的那样,您可以使用 版本 属性。这是使用 TIdHTTP 组件的示例:

As @Remy pointed out in his comment, you can get the Indy version from any Indy component by using the Version property. Here's a sample using TIdHTTP component:

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage('Indy version: ' + IdHTTP1.Version);
end;

如何在运行时获取没有Indy组件的Indy版本?

How to get version of Indy without an Indy component at runtime ?

您可以使用Indy的版本格式获取整个版本字符串:

You can get the whole version string in Indy's versioning format:

<major>.<minor>.<release>.<build>

gsIdVersion 常量中定义,包含在 IdGlobal.pas 单元中的code> IdVers.inc 文件,方法如下:

from the gsIdVersion constant defined in the IdVers.inc file included in the IdGlobal.pas unit in a way like follows:

uses
  IdGlobal;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage('Indy version: ' + gsIdVersion);
end;

或者,如果您至少自2012年10月25日以来拥有Indy修订版(4850),则可以使用该个人版本信息元素,如前所述,它们在相同的包含文件中定义,例如这样:

or if you have Indy revision at least since 25th October 2012 (4850), you can use the individual version information elements, whose are defined in the same include file as mentioned before e.g. this way:

uses
  IdGlobal;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage('Indy version: ' +
    IntToStr(gsIdVersionMajor) + '.' +
    IntToStr(gsIdVersionMinor) + '.' +
    IntToStr(gsIdVersionRelease) + '.' +
    IntToStr(gsIdVersionBuild)
  );
end;

如何在设计时获取Indy版本?

How to get version of Indy at design time ?

要在设计时获得Indy版本,您只需右键单击放置在表单上的任何Indy组件,然后打开其关于框通过关于Internet Direct(印地语)... 菜单项。

To get Indy version at design time you can simply right click any of the Indy's components dropped on a form and open its About box through the About Internet Direct (Indy)... menu item.

版本信息在哪里定义?

Where are the version information defined ?

正如我之前提到的,它在 IdVers.inc 包含存储在库的 .. \Lib\System\ 文件夹中的文件,它可能是下一个选项如何获取Indy的版本信息。

As I've mentioned before, it's in the IdVers.inc include file stored in the ..\Lib\System\ folder of the library and it might be the next option of how to get the Indy's version information.

免责声明

Disclaimer

此处提到的某些内容目前适用于Indy的最新版本,但是我不确定它是否也适用于所有较旧的版本(例如Indy 9)。

Some of what was mentioned here applies to the Indy's most recent version at this time, but I'm not sure if it applies also to all older versions (such as Indy 9 for instance).

这篇关于我可以检查安装的Indy版本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆