.NET 或 Win32 相当于“netsh http add urlacl”命令
有几个 有关如何允许自托管 WCF 应用程序使用的问题 BasicHttpBinding 与 HTTP.SYS 无需管理权限。归根结底,需要向 URL 授予权限(从管理上下文),然后用户就可以在指定的 URL 上托管任何内容。
netsh http add urlacl url=http://+:80/MyService
我会希望能够查询和添加注册的 URL,而无需解析“netsh”或“httpconfig”命令行工具的命令行输出。
是否有可以调用此功能的公共 Win32 或 .NET API?
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
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.
Is there is a public Win32 or .NET API that I can call for this functionality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要使用的 Win32 API 是 HttpSetServiceConfiguration 。
The Win32 API to use is HttpSetServiceConfiguration.
我的错误列表中确实有这个问题,但它目前的优先级较低,所以我还没有处理它。无论如何,我们发现这个工具(下载源代码)它使用了上述功能,并且它具有所有需要的代码工作(距离拥有 Win32 功能和工作解决方案还有很长的路要走)。
I have exactly this problem in my bug list but it has currently low priority so I didn't deal with it yet. Anyway we found this tool (download the source) which uses mentioned function and it has all needed code to work (it is long way from having Win32 function and having working solution).