.NET 或 Win32 等效的“netsh http add urlacl";命令 [英] .NET or Win32 Equivalent of "netsh http add urlacl" command

查看:33
本文介绍了.NET 或 Win32 等效的“netsh http add urlacl";命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几个 问题 关于如何允许自托管 WCF 应用程序使用 HTTP 的 BasicHttpBinding.SYS 不需要管理权限.归结为需要向 URL 授予权限(来自管理上下文),然后用户可以在指定的 URL 上托管任何内容.

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屋!

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