.NET 或 Win32 等效的“netsh http add urlacl";命令 [英] .NET or Win32 Equivalent of "netsh http add urlacl" command
问题描述
有几个
There are several questions around how to allow a self-hosted WCF application to use BasicHttpBinding with HTTP.SYS without requiring administrative privileges. It boils down to needing to grant permission (from an admin context) to the URL, then the user can host whatever at the specified URL.
netsh http add urlacl url=http://+:80/MyService
我希望能够查询和添加注册的 URL,而无需解析netsh"或httpconfig"命令行工具的命令行输出.
I would like to be able to query and add registered URLs without resorting to parsing commandline output of the "netsh" or "httpconfig" commandline tools.
是否有我可以调用此功能的公共 Win32 或 .NET API?
推荐答案
要使用的 Win32 API 是 HttpSetServiceConfiguration.
The Win32 API to use is HttpSetServiceConfiguration.
这篇关于.NET 或 Win32 等效的“netsh http add urlacl";命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!