如何在运行时获取表单 loginurl 的值?

How can I get the value of forms loginurl at runtime?

我的 web.config 里有这个:

...
<system.web>
    <sessionState mode="InProc" timeout="30" cookieless="UseCookies" />
    <authentication mode="Form">
      <forms loginUrl="http://myurl" path="/" cookieless="UseCookies" slidingExpiration="true" requireSSL="true" />
    </authentication>
...

如何在运行时获取 loginurl 的值?

System.Web.Security.FormsAuthentication.LoginUrl

Gets the URL for the login page that the FormsAuthentication class will redirect to.

详情见 MSDN