???? ID: 815174 - ????? ???????: 05 ?????? 2010 - ??????: 2.0

????????? ?? ???????-??????????? ??????????? ???????? ?? ???? asp.NET ????????? ??? ????? ???? ????

?????? ??????This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.

?? ????? ??

??? ?? ??????? ???? | ??? ?? ??????? ????

??????

?? ??? ?? ??? ???? ????? ???? ?? ?? ?????????-??????? ?? ??????????-??????? ??????????? ???????? ?? ????? ?? ??? asp.NET ?? ????? ???? ????? Web.config ????? ????? ?? asp.NET ????????? ?? ??? ??????????? ???? Web.config ????? ?? ????????? ?? ??? ??????? ?? ??????????? ??????? ?? ????????? ???? ??? ??-?????????? ?? ???? ?? ?? ??????????? ???????? ??? ?? ???? ???? ??? ???? ?? ??? ?? ????? ???:
  • ?????????? ??? ????????? ?? ??? ?? ?? ???? Web.config ??????? ?? ?????? ????? ???? ?????? ??????????? (Machine.config) ???? ??? ?? ???? higher-level Web.config ????? ??? ???????? ??????? ???????? ?? ??? asp.NET ????????? ?????????? ??? ??? Web.config ????? ???????
  • -?????????? ?????? ?? ?????-????? ???????? ????????? Web.config ????? ??? ?? ????-??????????? ??????????? ???????? ???? ???? ?? ??? ??? ??? Web.config ????? ?? ????? ???? ??? ?? ?? ???? ??? ?? ?? ???? ?? ????? Machine.config ????? ??? asp.NET ??? ????????? ?? ??????????? ???????? ?? ????? ???? ?? ??? ?? ??? Machine.config ??????? ?? Web.config ??????? ?? ??? ???? ?? ??? ?????????


Machine.config ???? ??? ????? ?? ???? ?? ????? ????


To specify settings that apply to a Web application or directory, you can add the?????> element to theconfiguration> element of a system Machine.config file. This is useful when you centralize configuration settings in a single file. This is also useful in Web-hosting environments to mandate specific configuration settings on individual Web applications.

The<location></location>element contains two attributes,??, ??allowOverride. The??attribute defines the site or virtual directory that the configuration settings cover. To specify that the settings in the<location></location>element apply to the default Web site, set the?????? ?? ??? ?????????????? ??? ????. ????????? ???? ?? ????????? ?? ??? ?? ??? ???????? ???? ???? ?? ???MyApp??????? ??? ???? ??? ??? ?????????? ?? ??? ???????"??????? ??? ????/MyApp".

??allowOverride??????? ??FALSE, ??? ????????? ???????????? ??? Web.config ??????? ?? ??????? ???????? ??? ????????? ???? ???? ?? ????<location></location>????? ?? ?????? ???? ?? ??? ?????? ?? ??? ????????? ???? ???????? ???? ??? ????????? ???????? ?????????? ?????? ????????? ??? ?????? ??? ????? ?????? ?? MyApp ????????? ?? ??????? ??? ???? ?? ??????? ?? ??? ??????? ?? ???????? ?? ?? ?? Web.config ????? ??? ???????? ?? ?????? overridden ?? ???? Machine.config ???? ?? ???? ??? ?? ?????? ??:
<configuration>
    <location path=?Default Web Site/MyApp? allowOverride=?false?>
        <system.web>
            <authorization>
                <allow users=??? />
            </authorization>
        </system.web>
    </location>
</configuration>




Use the Location Element in the Web.config File


To specify settings that apply to a specific application or directory, add the?????> element to theconfiguration> element of an application Web.config file. The?????> element typically contains asystem.web> element and other configuration elements exactly as you use them in the Web.config file. The???? ????????????> element specifies the virtual directory or the file name where the location configuration items apply. The following example shows part of an application Web.config file that specifies custom error messages for the forum virtual directory.
<configuration>
    <location path=?forum? >
        <system.web>
            <customErrors mode="RemoteOnly? defaultRedirect="forum-error.aspx">
                <error statusCode="404" redirect="forum-file-not-found.aspx" />
            </customErrors>
        </system.web>
    </location>
</configuration>




??????

???????? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
818016  (http://support.microsoft.com/kb/818016/ ) ????????? ?? .NET Framework ????? ???? ?? ?????????? ???? ?? ??? ???? ????
???? ??????? ?? ???, ????? Microsoft ?????? ??????? ??? ???? ?? ????:

ASP.NET ???????????
(VS.71) http://msdn2.Microsoft.com/en-us/library/aa719558 .aspx (http://msdn2.microsoft.com/en-us/library/aa719558(VS.71).aspx)

ASP.NET ??????????? ??????? ?? ??????
(vs.71) http://msdn2.Microsoft.com/en-us/library/ackhksh7 .aspx (http://msdn2.microsoft.com/en-us/library/ackhksh7(vs.71).aspx)

Deploying ?????????
(vs.71) http://msdn2.Microsoft.com/en-us/library/ybshs20f .aspx (http://msdn2.microsoft.com/en-us/library/ybshs20f(vs.71).aspx)

???? ???? ???? ??:
  • Microsoft ASP.NET 1.0
  • Microsoft ASP.NET 1.1
??????: 
kbdir kbwebservices kbwebserver kbwebforms kbconfig kbhowtomaster kbmt KB815174 KbMthi
???? ?????? ???????????? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:815174  (http://support.microsoft.com/kb/815174/en-us/ )