[英]Is WinHttpRequest.5.1 a good API for Windows 11 or does it require Iexplorer?
I am using this code to load files during setup, is WinHttpRequest.5.1 a good API for Windows 11 or does this API have some dependensies to Internet Explorer?我在设置过程中使用此代码加载文件,WinHttpRequest.5.1 是 Windows 11 的良好 API 还是此 API 对 Internet Explorer 有一些依赖?
function DownloadFile(const AURL: string; var AResponse: string): Boolean;
var
WinHttpRequest: Variant;
begin
Result := True;
try
WinHttpRequest := CreateOleObject('WinHttp.WinHttpRequest.5.1');
WinHttpRequest.Open('GET', AURL, False);
WinHttpRequest.Send;
AResponse := WinHttpRequest.ResponseText;
except
Result := False;
AResponse := GetExceptionMessage;
end;
end;
I do not think that WinHttpRequest
has dependency on Internet Explorer.我不认为WinHttpRequest
依赖于 Internet Explorer。 And even if it did depend on some internals of IE, I'm sure Microsoft would keep those internals to keep the WinHttpRequest
working.即使它确实依赖于 IE 的某些内部结构,我相信微软会保留这些内部结构以保持WinHttpRequest
正常工作。
In any case, WinHttpRequest
still works on Windows 11.无论如何, WinHttpRequest
仍然适用于 Windows 11。
From the document https://docs.microsoft.com/en-us/windows/win32/winhttp/winhttp-versions :从文档https://docs.microsoft.com/en-us/windows/win32/winhttp/winhttp-versions :
WinHTTP Versions WinHTTP 版本
01/07/2021 2021 年 1 月 7 日
Users of Microsoft Windows HTTP Services (WinHTTP) should use the latest version of the technology, version 5.1. Microsoft Windows HTTP 服务 (WinHTTP) 的用户应使用该技术的最新版本 5.1。 Version 5.0 is no longer supported.不再支持 5.0 版。
Version 5.1 5.1 版
WinHTTP 5.1 offers improvements over version 5.0; WinHTTP 5.1 提供了对 5.0 版的改进; for more information about new features, see What's New in WinHTTP 5.1 .有关新功能的更多信息,请参阅WinHTTP 5.1 中的新增功能。
With version 5.1, WinHTTP is an operating-system component of the following operating systems:对于 5.1 版,WinHTTP是以下操作系统的操作系统组件:
- Windows 2000, Service Pack 3 and later (except Datacenter Server) Windows 2000,Service Pack 3 及更高版本(数据中心服务器除外)
- Windows XP with Service Pack 1 (SP1) and later Windows Server 2003 with Service Pack 1 (SP1) and later Windows XP 带 Service Pack 1 (SP1) 及更高版本 Windows Server 2003 带 Service Pack 1 (SP1) 及更高版本
... ...
Given that it says "Windows 2000...and later" it seems clear that this is a component you can reliably use in Win11.鉴于它说“Windows 2000 ...及更高版本”,显然这是一个您可以在 Win11 中可靠使用的组件。 And it has nothing to do with IE.和IE无关。 (*) (*)
(*) It sounds like according to this page at one time IE may have been a dependency: " Redistributable: WinHTTP 5.0 and Internet Explorer 5.01 or later on Windows XP and Windows 2000. " (*) 根据此页面,有时 IE 可能是一个依赖项:“可再发行:Windows XP 和 Windows 2000 上的 WinHTTP 5.0 和 Internet Explorer 5.01 或更高版本。 ”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.