Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个提供 Web 服务的服务文件 Service.svc。我希望帮助页面成为主 url(例如 / 而不是 /Service.svc/help)。这可能吗,有人可以告诉我怎么做吗?
只需重定向到帮助页面。例如:
[WebInvoke(UriTemplate = "", Method = "GET")] public void RedirectToHelp() { WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.Redirect; WebOperationContext.Current.OutgoingResponse.Location = "help"; }