gpt4 book ai didi

xml - 使用Delphi如何确定系统中是否安装了MSXML6?

转载 作者:数据小太阳 更新时间:2023-10-29 02:22:32 24 4
gpt4 key购买 nike

我有一个依赖于 MSXML6 的应用程序, 在部署应用程序时,大多数机器上已经安装了这个包,但在少数情况下没有安装 MSXML6,问题是我如何检查 MSXML 6 是否已经安装?

最佳答案

您可以使用 CLSIDFromProgID 检查注册表中是否存在 CLSID函数,对于 MSXML,CLSID 是 Msxml2.DOMDocument.6.0

检查这个示例应用

uses
ActiveX,
SysUtils;

{
Msxml2.DOMDocument.2.6
Msxml2.DOMDocument.3.0
Msxml2.DOMDocument.4.0
Msxml2.DOMDocument.5.0
Msxml2.DOMDocument.6.0
}
var
clsid: TCLSID;
begin
try
if Succeeded(CLSIDFromProgID('Msxml2.DOMDocument.6.0', clsid)) then
Writeln('MSXML 6.0 Installed')
else
Writeln('MSXML 6.0 Not Installed');
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.

关于xml - 使用Delphi如何确定系统中是否安装了MSXML6?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9846290/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com