<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=ASP.NET_Tutorial%2FConfiguration%2FIntroduction</id>
		<title>ASP.NET Tutorial/Configuration/Introduction - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=ASP.NET_Tutorial%2FConfiguration%2FIntroduction"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=ASP.NET_Tutorial/Configuration/Introduction&amp;action=history"/>
		<updated>2026-04-29T19:24:45Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=ASP.NET_Tutorial/Configuration/Introduction&amp;diff=2789&amp;oldid=prev</id>
		<title> в 15:30, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=ASP.NET_Tutorial/Configuration/Introduction&amp;diff=2789&amp;oldid=prev"/>
				<updated>2010-05-26T15:30:57Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:30, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=ASP.NET_Tutorial/Configuration/Introduction&amp;diff=2790&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=ASP.NET_Tutorial/Configuration/Introduction&amp;diff=2790&amp;oldid=prev"/>
				<updated>2010-05-26T11:57:09Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Adding Custom Application Settings==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
File: Web.config&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
  &amp;lt;appSettings&amp;gt;&lt;br /&gt;
    &amp;lt;add key=&amp;quot;welcome&amp;quot; value=&amp;quot;Welcome to our Web site!&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;add key=&amp;quot;copyright&amp;quot; value=&amp;quot;Copyright (c) 2007 by the company&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/appSettings&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Applying Configuration Settings to a Particular Path==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
By default, the settings in a Machine.config or Web.config file are applied to all pages in the same folder and below. &lt;br /&gt;
You can apply configuration settings to a particular path. &lt;br /&gt;
You apply configuration settings to a particular path by using the &amp;lt;location&amp;gt; element. &lt;br /&gt;
For example, the following web configuration file enables password-protection for a single file named Secret.aspx.&lt;br /&gt;
The &amp;lt;location&amp;gt; element must be added as an immediate child of the &amp;lt;configuration&amp;gt; element. &lt;br /&gt;
File: Web.config&lt;br /&gt;
&amp;lt;configuration &amp;gt;&lt;br /&gt;
  &amp;lt;system.web&amp;gt;&lt;br /&gt;
    &amp;lt;authentication mode=&amp;quot;Forms&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/system.web&amp;gt;&lt;br /&gt;
  &amp;lt;location path=&amp;quot;Secret.aspx&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
      &amp;lt;authorization&amp;gt;&lt;br /&gt;
        &amp;lt;deny users=&amp;quot;?&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/authorization&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
  &amp;lt;/location&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Locking Configuration Settings==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
You can lock configuration settings so that they cannot be overridden at a lower level in the configuration hierarchy. &lt;br /&gt;
The following Web.config file locks a setting by using the allowOverride=&amp;quot;false&amp;quot;.&lt;br /&gt;
File: Web.config&lt;br /&gt;
&amp;lt;configuration &amp;gt;&lt;br /&gt;
  &amp;lt;location allowOverride=&amp;quot;false&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
      &amp;lt;compilation debug=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
  &amp;lt;/location&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Lock the debug attribute, and only the debug attribute, of the &amp;lt;compilation&amp;gt; element.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
File: Web.config&lt;br /&gt;
&amp;lt;configuration &amp;gt;&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
      &amp;lt;compilation debug=&amp;quot;false&amp;quot; lockAttributes=&amp;quot;debug&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Opening a Configuration File on a Remote Server==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
Enable the remote server to accept remote configuration connections by executing the following command from a command prompt:&lt;br /&gt;
aspnet_regiis -config+&lt;br /&gt;
&lt;br /&gt;
To disable remove configuration connections, execute the following command:&lt;br /&gt;
aspnet_regiis -config-&lt;br /&gt;
&lt;br /&gt;
The aspnet_regiis tool is located in the following path:&lt;br /&gt;
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe&lt;br /&gt;
&lt;br /&gt;
&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;%@ Import Namespace=&amp;quot;System.Web.Configuration&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;br /&gt;
&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
    protected void btnSubmit_Click(object sender, EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {&lt;br /&gt;
            Configuration config = WebConfigurationManager.OpenMachineConfiguration(null, txtServer.Text, txtUserName.Text, txtPassword.Text);&lt;br /&gt;
            AuthenticationSection section = (AuthenticationSection)config.GetSection(&amp;quot;system.web/authentication&amp;quot;);&lt;br /&gt;
            lblAuthenticationMode.Text = section.Mode.ToString();&lt;br /&gt;
        }&lt;br /&gt;
        catch (Exception ex)&lt;br /&gt;
        {&lt;br /&gt;
            lblAuthenticationMode.Text = ex.Message;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;head id=&amp;quot;Head1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;Show Config Remote&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div&amp;gt;&lt;br /&gt;
    &amp;lt;asp:Label&lt;br /&gt;
        id=&amp;quot;lblServer&amp;quot;&lt;br /&gt;
        Text=&amp;quot;Server:&amp;quot;&lt;br /&gt;
        AssociatedControlID=&amp;quot;txtServer&amp;quot;&lt;br /&gt;
        Runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;asp:TextBox&lt;br /&gt;
        id=&amp;quot;txtServer&amp;quot;&lt;br /&gt;
        Runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;asp:Label&lt;br /&gt;
        id=&amp;quot;lblUserName&amp;quot;&lt;br /&gt;
        Text=&amp;quot;User Name:&amp;quot;&lt;br /&gt;
        AssociatedControlID=&amp;quot;txtUserName&amp;quot;&lt;br /&gt;
        Runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;asp:TextBox&lt;br /&gt;
        id=&amp;quot;txtUserName&amp;quot;&lt;br /&gt;
        Runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;asp:Label&lt;br /&gt;
        id=&amp;quot;lblPassword&amp;quot;&lt;br /&gt;
        Text=&amp;quot;Password:&amp;quot;&lt;br /&gt;
        AssociatedControlID=&amp;quot;txtPassword&amp;quot;&lt;br /&gt;
        Runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;br /&amp;gt;&lt;br /&gt;
     &amp;lt;asp:TextBox&lt;br /&gt;
        id=&amp;quot;txtPassword&amp;quot;&lt;br /&gt;
        TextMode=&amp;quot;Password&amp;quot;&lt;br /&gt;
        Runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;asp:Button&lt;br /&gt;
        id=&amp;quot;btnSubmit&amp;quot;&lt;br /&gt;
        Text=&amp;quot;Submit&amp;quot;&lt;br /&gt;
        OnClick=&amp;quot;btnSubmit_Click&amp;quot;&lt;br /&gt;
        Runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;hr /&amp;gt;&lt;br /&gt;
    Authentication Mode:&lt;br /&gt;
    &amp;lt;asp:Label&lt;br /&gt;
        id=&amp;quot;lblAuthenticationMode&amp;quot;&lt;br /&gt;
        Runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Overview of Website Configuration==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
ASP.NET uses a hierarchical system of configuration. &lt;br /&gt;
At the top of the hierarchy is the Machine.config file. &lt;br /&gt;
This Machine.config file contains all the default configuration settings for ASP.NET.&lt;br /&gt;
The Machine.config file is located at:&lt;br /&gt;
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\Machine.config&lt;br /&gt;
&lt;br /&gt;
This same folder also contains a Web.config file. &lt;br /&gt;
The Web.config file contains settings specific to ASP.NET applications. &lt;br /&gt;
The Web.config file overrides particular settings in the Machine.config file.&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Placing Configuration Settings in an External File==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
File: Web.config&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
  &amp;lt;appSettings configSource=&amp;quot;appSettings.config&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
File: appSettings.config&lt;br /&gt;
&amp;lt;appSettings&amp;gt;&lt;br /&gt;
  &amp;lt;add key=&amp;quot;message&amp;quot; value=&amp;quot;Hello World!&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/appSettings&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== The web.config File==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
Every web application inherits the settings from the machine.config file. &lt;br /&gt;
You can apply application-specific settings. &lt;br /&gt;
The entire content of an ASP.NET configuration file is nested in a root &amp;lt;configuration&amp;gt; element. &lt;br /&gt;
&amp;lt;system.web&amp;gt; element is used for ASP.NET settings. &lt;br /&gt;
Inside the &amp;lt;system.web&amp;gt; element are separate elements for each aspect of configuration.&lt;br /&gt;
ASP.NET uses a multilayered configuration system. &lt;br /&gt;
To use this technique, you need to create additional subdirectories inside your virtual directory. &lt;br /&gt;
These subdirectories can contain their own web.config files. &lt;br /&gt;
ASP.NET uses configuration inheritance so that each subdirectory acquires the settings from the parent directory.&lt;br /&gt;
If settings conflict, the settings from a web.config in a nested directory always override the settings inherited from the parent.&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Using &amp;lt;location&amp;gt; Elements==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
The following web.config file uses the &amp;lt;location&amp;gt; element to create two groups of settings.&lt;br /&gt;
One for the current directory and one that applies only to files in the subdirectory named Secure:&lt;br /&gt;
&amp;lt;configuration xmlns=&amp;quot;http://schemas.microsoft.ru/.NetConfiguration/v2.0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
        &amp;lt;!-Basic configuration settings go here. --&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
    &amp;lt;location path=&amp;quot;/Secure&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;system.web&amp;gt;&lt;br /&gt;
            &amp;lt;!-Configuration settings for the Secure subdirectory go here. --&amp;gt;&lt;br /&gt;
        &amp;lt;/system.web&amp;gt;&lt;br /&gt;
    &amp;lt;/location&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>